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

RE: XSLT and XML Schema

Subject: RE: XSLT and XML Schema
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 13 Jun 2007 16:30:03 +0100
RE:  XSLT and XML Schema
Well, in principle an XML Schema document is XML so you can use it as an
input to your stylesheet. But it's not easy to process unless you know the
coding standards that have been followed, because there are many different
ways of writing equivalent schemas. The next Saxon release will offer an
"predigested" XML representation of the schema component model that aims to
help with that.

Incidentally, attributes should be regarded as unordered: the concept of
"the third attribute" is not very meaningful.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Garvin Riensche [mailto:g.riensche@xxxxxxx] 
> Sent: 13 June 2007 15:51
> To: XSL-LIST
> Subject:  XSLT and XML Schema
> 
> Hi,
> 
> I am looking for tutorials about the use of XML Schema within 
> Stylesheets where the schema is used to get information about 
> the source document structure. I know how I can use XML 
> Schema for validation of a document or a part of it but what 
> I am looking for is how I can get information about the 
> source document structure from the schmema.
> 
> Let me post an example:
> 
> Suppose the following XML as input together with his 
> associated schema. 
> The parser will additionally get the parameter SrcName='A'
> 
> <class id="2" pkgid="1" classname="A">
> 	<field id="21" type="basic" typename="int" name="publ_int_i"/>
> 	<field id="22" type="basic" typename="long" name="long_d"/>
> 	<modifier modified_id="21" modifier="public"/> </class>
> 
> When creating the stylesheet (which should be created 
> dynamically later), I know that there is "class" Element with 
> 3 attributes but I don't know the name of the attributes. Is 
> it possible to get the names of the attributes from the 
> schema so that they can be used in a <xsl:match> element like
> 
> <xsl:match
> pattern="//class[*ask-schema-which-attribute-is-the-third-one(
> )=$SrcName*]>
> ?
> 
> Maybe this sounds confusing but what this all is about is a 
> comparison between so called "conditional transformations 
> (cts)", which are implemented in prolog and are used to 
> transform prolog facts, and xslt. 
> The prolog facts are translated to XML and I am trying to 
> translate these cts to xslt to see what is more powefull, cts or xslt.
> 
> Regards,
> Garvin

Current Thread

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
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.