P
ppl
I'm very new to XSL and have come across a stumbling block with a
recent assignment at work. I need to translate from XML to XML using
an XSL style sheet. Here is the input XML:
<?xml version="1.0" encoding="GB2312"?>
<?xml-stylesheet type="text/xsl" href="untitled9.xsl"?>
<booklist>
<book>
<title>bookname1</title>
<price>80</price>
<amount>3</amount>
</book>
<book>
<title>bookname2</title>
<price>60</price>
<amount>2</amount>
</book>
</booklist>
which needs to be transformed to:
<?xml version="1.0" encoding="GB2312"?>
<?xml-stylesheet type="text/xsl" href="untitled9.xsl"?>
<booklist>
<book>
<title>bookname1</title>
<price>80</price>
<amount>3</amount>
<total>240</total>
</book>
<book>
<title>bookname2</title>
<price>60</price>
<amount>2</amount>
<total>120</total>
</book>
</booklist>
I want to copy all content from source XML and insert an element on
specificall node, can anyone konw?
recent assignment at work. I need to translate from XML to XML using
an XSL style sheet. Here is the input XML:
<?xml version="1.0" encoding="GB2312"?>
<?xml-stylesheet type="text/xsl" href="untitled9.xsl"?>
<booklist>
<book>
<title>bookname1</title>
<price>80</price>
<amount>3</amount>
</book>
<book>
<title>bookname2</title>
<price>60</price>
<amount>2</amount>
</book>
</booklist>
which needs to be transformed to:
<?xml version="1.0" encoding="GB2312"?>
<?xml-stylesheet type="text/xsl" href="untitled9.xsl"?>
<booklist>
<book>
<title>bookname1</title>
<price>80</price>
<amount>3</amount>
<total>240</total>
</book>
<book>
<title>bookname2</title>
<price>60</price>
<amount>2</amount>
<total>120</total>
</book>
</booklist>
I want to copy all content from source XML and insert an element on
specificall node, can anyone konw?