This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Can XPath / XSLT be aware of XML Schema content models grouping i nformation ?

[Get raw message]

Dear Jeni,

> We had a big discussion here a few weeks ago about whether
> there were actually any real-world requirements for accessing schema
> from XSLT. It seems there are lots of hypotheticals, but very few real
> cases, which is why I was quite interested in yours, particularly as
> the position of the particle corresponding to an element within a
> model group isn't something usually considered as important
> information.

I "invented" this "real world" example :) as a support for this discussion.

The source and result documents describe both a map containing a list 
of points with optional label. However the source document "flatten" the
list.

Source schema:
--------------
<xsd:complexType name="Map">
   <xsd:sequence maxOccurs="unbounded">
      <xsd:element name="X" type="xsd:integer">      
      <xsd:element name="Y" type="xsd:integer">   
      <xsd:element name="Label" type="xsd:string" minOccurs=0>   
   </xsd:sequence>
</xsd:complexType>


Result schema:
--------------
<xsd:complexType name="Map">
   <xsd:sequence>      
      <xsd:element name="Point" maxOccurs="unbounded">
         <xsd:complexType name="Map">
            <xsd:sequence>      
               <xsd:element name="X" type="xsd:integer">      
               <xsd:element name="Y" type="xsd:integer">   
               <xsd:element name="Label" type="xsd:string" minOccurs=0>   
            </xsd:sequence>      
         </xsd:complexType>
      </xsd:element>
   </xsd:sequence>      
</xsd:complexType>


So, without being able to do a <xslt:for-each> on the sequence, the
conversion seems to me already quite complex if you consider the potential
abscence of the Label element in the sequence.


> The more information is available in the data model, the more it's
> tied to a particular schema language.
So, in your mind where is the right balance ? 
Maybe a neutral / generic schema infoset in the XPath data model ?


Best regards,
Jerome

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]