qt4cg / qtspecs

QT4 specifications
https://qt4cg.org/
Other
28 stars 15 forks source link

Invisible-xml function: why is $grammar of type item()? #1404

Closed michaelhkay closed 1 week ago

michaelhkay commented 2 weeks ago

In the invisible-xml function, the $grammar argument has type item()?. There's no evident reason why it isn't xs:string?; there's no clue in the specification or example what it might mean to supply something that isn't a string (or an empty sequence).

Note that declaring it as item() rather than xs:string? suppresses atomization of the supplied value.

ndw commented 2 weeks ago

Just me trying not to close any doors, but failing to think about atomization in the moment. I'll make a PR to fix it.

AlainCouthures commented 2 weeks ago

It would allow to directly provide the document resulting from the iXML grammar parsing for more performance. --AlainLe 27/08/2024, 23:12 Michael Kay @.***> a écrit:

In the invisible-xml function, the $grammar argument has type item()?. There's no evident reason why it isn't xs:string?; there's no clue in the specification or example what it might mean to supply something that isn't a string (or an empty sequence). Note that declaring it as item() rather than xs:string? suppresses atomization of the supplied value. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

michaelhkay commented 2 weeks ago

If there's a deliberate intention to allow, for example, an XML representation of the iXML grammar, then I've no problem with that so long as it's explained.

ndw commented 2 weeks ago

Indeed. I may have jumped the gun. It's not unreasonable for the input grammar to be in XML. I think. I will write a test for that :-)