xsl-list
[Top] [All Lists]

RE: [xsl] use transformator to add nodes to the xml stucture

2008-12-15 15:09:39
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(_at_)yahoo(_dot_)de] 
Sent: 15 December 2008 19:33
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] 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


      

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--