[Mono-list] mono-xmltool and relaxng compact include
Travis Staloch
twostepted at yahoo.com
Sat Dec 15 16:54:39 EST 2007
Atsushi,
Thanks for the pointer. I've been able to get a little further on this with your help. However, I'm still running into a validation problem when using an include.
I've enclosed the include in a grammar as you suggested and that got rid of that error message I mentioned before. But I'm still getting an error. If I run 'mono-xmltool --validate simple.rnc simple.xml' against simple.rnc (1), I get the following:
Argument cannot be null.
Parameter name: uriString
However, If I copy the content of Strippable.rnc into simple.rnc and omit the include [as in simple.rnc (2)], mono-xmltool just says "done" which seems to indicate that the validation was a success. I can only conclude that the include failed.
Note that I was only able to use the interleave if I enclosed the interleaved items with parenthesis as in "(child1 & child2)" below. If the parenthesis are excluded, I get an error. It doesn't seem correct that these should need to be grouped together in this way?
Regards,
Travis
(1) - simple.rnc (with include)
------
grammar {
start = root
root = element root {
strippableAttributes,
( child1 & child2 )
}
child1 = element child1 {text}*
child2 = element child2 {text}*
include "Strippable.rnc"
}
(2) - simple.rnc (without include)
------
grammar {
start = root
root = element root {
strippableAttributes,
( child1 &
child2 )
}
child1 = element child1 {text}*
child2 = element child2 {text}*
strippableAttributes = (
attribute strip {text}?,
attribute length {text}?,
attribute no_strip {text}?,
attribute start_pos {text}?,
attribute strip_after {text}?
)
}
Strippable.rnc
------
strippableAttributes = (
attribute strip {text}?,
attribute length {text}?,
attribute no_strip {text}?,
attribute start_pos {text}?,
attribute strip_after {text}?
)
simple.xml
------
<root>
<child1>Some text</child1>
<child2>Some text</child2>
<child2>Some text</child2>
<child1>Some text</child1>
</root>
----- Original Message ----
From: Atsushi Eno <atsushi at ximian.com>
To: Travis Staloch <twostepted at yahoo.com>
Cc: mono-list at ximian.com
Sent: Friday, December 14, 2007 2:53:28 AM
Subject: Re: [Mono-list] mono-xmltool and relaxng compact include
Ok, I've revisited the compact syntax land and noticed that you
don't use "grammar" which is mandatory to enclose "include" items.
http://www.oasis-open.org/committees/relax-ng/compact-20021121.html
So it's a bug in your grammar.
Atsushi Eno
Travis Staloch wrote:
>
> Atsushi,
>
> Oh yes, obviously need that too. My mistake. Here it is.
>
> The simple.rnc I posted last message doesn't really make use of the
> contents of Strippable.rnc. To fully test the include, we should
make
> sure to use one of the objects defined in this file. I've also
posted a
> modified Simple.rnc below which does this.
>
> Cheers,
>
> Travis
>
> Strippable.rnc
> -------
> strippableAttributes = (
> attribute strip {text}?,
> attribute length {text}?,
> attribute no_strip {text}?,
> attribute start_pos {text}?,
> attribute strip_after {text}?
> )
>
>
> Simple.rnc (modified)
> ------
> include "Strippable.rnc"
>
> element root {
> strippableAttributes,
> element child1 {text}* &
> element child2 {text}*
> }
>
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile.
Try
> it now.
>
<http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> >
>
>
>
------------------------------------------------------------------------
>
> _______________________________________________
> Mono-list maillist - Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20071215/66315c21/attachment.html
More information about the Mono-list
mailing list