[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xml-dev] PSVI using existing infoset items
- From: Eric van der Vlist <vdv@dyomedea.com>
- To: xml-dev@lists.xml.org
- Date: Tue, 16 Oct 2001 19:33:59 +0200
Henry,
Henry S. Thompson wrote:
> Eric van der Vlist <vdv@dyomedea.com> writes:
>
>
>>I have already tried to submit the idea a couple of times, but it
>>doesn't seem to get any echo... I'd like to give it a last chance
>>and after this, I promiss to stop pestering you!
>>
>
> Not only is it a good idea, we've done it! See [1].
>
> ht
>
> [1] http://www.w3.org/2001/05/serialized-infoset-schema.html
>
I had a closer look and it's quite different from what I was thinking of.
Let's take a very simple example...
XML:
<foo>
<bar>...</bar>
</foo>
XSD:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="foo" type="foo"/>
<xs:complexType name="foo">
<xs:sequence>
<xs:element name="bar" type="xs:string" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
The PSVI you generate is a complete serialization of the PSVI and, thus,
very different from the original instance document:
<document xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:psv='http://www.w3.org/2001/05/PSVInfosetExtension'
xmlns='http://www.w3.org/2001/05/XMLInfoset'>
<children>
<element id='g1'>
<namespaceName xsi:nil='true'/>
<localName>library</localName>
<prefix xsi:nil='true'/>
<children>
<character>
<characterCode>10</characterCode>
<elementContentWhitespace>false</elementContentWhitespace>
</character>
<character>
<characterCode>9</characterCode>
<elementContentWhitespace>false</elementContentWhitespace>
</character>
<element>
<namespaceName xsi:nil='true'/>
<localName>book</localName>
<prefix xsi:nil='true'/>
<children>
<character>
...
What I had in mind is something that could be processed exactly like the
original document with some information added, something such as (very
rough draft):
<foo xmlns:...>
<psvi:element type="complex" datatype="foo" whitespace="false"/>
<bar>
<psvi:element type="simple" datatype="xs:string"
primary="xs:string"
minOccurs="0" maxOccurs="unbounded" whitespace="false"/>
...</bar>
</foo>
An application could just pick the info it needs and ignore all the
other stuff from the "psvi" namespace.
For instance, a XSLT transformation written on the source instance
document would just need to add a template ignoring "psvi:*" to produce
the same result on the PSVI document and could immediately take
advantage of the psvi info (match="*[psvi:element/@primary='xs:string']"
would match all the elements having a string primary datatype).
Eric
--
Rendez-vous à Paris pour le Forum XML.
http://www.technoforum.fr/Pages/forumXML01/index.html
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
http://xsltunit.org http://4xt.org http://examplotron.org
------------------------------------------------------------------------