This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Can XPath / XSLT be aware of XML Schema content models grouping i nformation ?
- To: "'Jeni Tennison'" <jeni at jenitennison dot com>, Jerome Louvel <Jerome dot Louvel at Metaserver dot com>
- Subject: RE: [xsl] Can XPath / XSLT be aware of XML Schema content models grouping i nformation ?
- From: Jerome Louvel <Jerome dot Louvel at Metaserver dot com>
- Date: Tue, 13 Nov 2001 14:23:39 -0500
- Cc: "Xsl-List (E-mail)" <xsl-list at lists dot mulberrytech dot com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
[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