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

RE: use transformator to add nodes to the xml stuctur

Subject: RE: use transformator to add nodes to the xml stucture
From: henry human <henry_human@xxxxxxxx>
Date: Mon, 15 Dec 2008 21:33:06 +0100 (CET)
RE:  use transformator to add  nodes to the xml stuctur
Hi Michael
thanks. The situation is, the originally xml is
actually existing as XML stream, it means, it is saved
in as DOM tree inside the Java program. The XSLT file
should be load inside the JAVA to operate on the DOM
tree structure. After that the output should be saved
again in the DOM tree inside the java program.. Can i
call from Java code the saxon to do the
transformation?


--- Michael Kay <mike@xxxxxxxxxxxx> schrieb:

> Yes, this is very easy to do with XSLT. You just
> have to define the rules.
> For example, this one might be
> 
>   <xsl:template match="Sales">
>     <Sales>
>       <xsl:copy-of select="SalesId, Currency"/>
>       <Car>
>         <Mileage>empty</Mileage>
>         <Description>empty</Description>
>         <Discount currency="empty">empty</Discount>
>       </Car>
>     </Sales>
>   </xsl:template>  
> 
> Michael Kay
> http://www.saxonica.com/ 
> 
> > -----Original Message-----
> > From: henry human [mailto:henry_human@xxxxxxxx] 
> > Sent: 15 December 2008 19:33
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject:  use transformator to add nodes to
> the xml stucture
> > 
> > Hi
> > It is following situation.
> > In a Java application I read  XML messages. After
> parsing I 
> > am going to complete the message with additional
> attributes 
> > and nodes according to the
> > templates:
> > 
> > before:
> >   <Sales>
> >             <SalesId>1</SalesId>
> >             <Currency>YEN</Currency>
> >    </Sales>
> >    
> >    after:   
> >   <Sales>
> >             <SalesId>1</SalesId>
> >             <Currency>YEN</Currency>
> >             <Car>
> >                <Mileage>empty</Mileage>
> >                <Description>empty</Description>
> >                <Discount
> > currency="empty">empty</Discount>
> >          </Car>
> >    </Sales>
> > 
> > Above is only one sample message but there are
> many different 
> > messages with different structure.
> > Is there a way to use XSLT files and a
> Transformator (f.i. 
> > saxon) to do it ?
> > Thanks for any help

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.