[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: PSVI using existing infoset items

  • From: Eric van der Vlist <vdv@d...>
  • To: xml-dev@l...
  • Date: Tue, 16 Oct 2001 19:33:59 +0200

using xsi nil
Henry,

Henry S. Thompson wrote:

> Eric van der Vlist <vdv@d...> 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
------------------------------------------------------------------------


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.