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

RE: Subtype/inheritance in XML, how does XSLT handle i

Subject: RE: Subtype/inheritance in XML, how does XSLT handle it?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 27 Aug 2005 09:48:15 +0100
RE:  Subtype/inheritance in XML
The "subtypes" and "inheritance" are in your mind: XSLT doesn't know that
this is the way you interpret the semantics of your XML. As far as XSLT is
concerned, you're simply following references. 

Before embarking on code I think I would want a better specification of the
problem. For example, are the names A and B, doc and v1 fixed, or do you
want something more generic? Can there be multiple levels of indirection?
Could <doc> itself contain a ref attribute that points somewhere else? Might
there be namespaces involved?

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

> -----Original Message-----
> From: Agnisys Technology (P) Ltd. [mailto:agnisys@xxxxxxxxx] 
> Sent: 27 August 2005 04:44
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Subtype/inheritance in XML, how does XSLT handle it?
> 
> Hi,
>   Can XSL handle subtypes/inheritance in XML? 
> 
> I have an XML document that "declares" a type "someA" and 
> then uses it, as follows:
> <top>
>   <A_DEC name="someA">
>     <doc>  aaaaaaa </doc>
>     <v1> 100 </v1>
>   </A_DEC>
> 
>   <B>
>      <A ref="A_DEC" name="someA">
>         <doc>  bbb </doc>
>      </A>        
>   </B>
> </top>
> ---------------------
> I want this to be transformed into :
> A.doc   = bbb
> A.v1    = 100
> ---------------------
> Note that doc value is overridden from the XML doc and the v1 
> value is used from the original
> definition.
> 
> How do I make XSLT use the entity "A_DEC" when it encounters A?
> 
> I'm designing the XML language, so I have the flexibility. If 
> this kind of problem is solved
> differently in XML, please advice.
> 
> I would much appreciate even partial answers or any pointers.
> Thanks,
> Anupam.
> 
> P.S. I'm new to XML, and to this list, please excuse if this 
> question has been answered before.
> Unfortunately I couldn't find the answer when I searched.
> 
> 
> 
> 
> 		
> ____________________________________________________
> Start your day with Yahoo! - make it your home page 
> http://www.yahoo.com/r/hs 

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.