xsl-list
[Top] [All Lists]

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

2008-12-15 17:14:22
You are asking questions on the level of "Can I use
Java to read a file?" 
:)
good approach but unfortunatelly XSLT is not my favor
Thanks for yours and Jespers hints. I had some succeed
with the transformation!
regards
Henry


The answer is yes, but you really can't expect to
learn the language by
asking a succession of questions like that on a
forum. It's a very
inefficient learning technique both for you and for
all the other forum
members. Spend a few hours with a good XSLT book,
then come back when you
are stuck.

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

-----Original Message-----
From: henry human [mailto:henry_human(_at_)yahoo(_dot_)de] 
Sent: 15 December 2008 20:57
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] use transformator to add nodes
to the xml stucture

thanks.


Does it possible to create the template as showing
in the pseudo code:
 <xsl:template match="Sales">
    <Sales>
    //if SalesId exists than
     <xsl:copy-of select="SalesId"/>
    //else                          
     <SalesId></SalesId>
      <Car>
        //if mileage exists than
     <xsl:copy-of select="Mileage"/>
    //else 
    <Mileage></Mileage>
    //if Description exists than
    <xsl:copy-of select="Description"/>
    //else
    <Descriptio></Description>
    //if discount exist than  
    <xsl:copy-of select="Discount" />
        //else 
        <Discount currency=""></Discount>
      </Car>
    </Sales>
  </xsl:template> 
  
  and Have the Result like this  
    <Sales>
        <SalesId>1</SalesId>
       <Currency>YEN</Currency>

      <Car>
        <Mileage></Mileage>
        <Description></Description>
        <Discount currency=""></Discount>
      </Car>
    </Sales>

?




--- Jesper Tverskov <jesper(_dot_)tverskov(_at_)gmail(_dot_)com>
schrieb:

Do you use a xslt processor (f.i. saxon) to
create
the
output.xml?

Yes, any XSLT processor will do but go for an
XSLT 2.0 
processor like 
Saxon is possible.

Cheers,
Jesper Tverskov




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




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