Solved

generate xml from xsl using xsl

Posted on 2013-12-09
4
257 Views
Last Modified: 2013-12-09
dear all,
need to generate xml using xsl
<templates>
      <template id="47253">
            <id>47253</id>
            <state>1</state>
            <price>75</price>
            <exc_price>4500</exc_price>
</template>
</templates>
from
<templates>
      <template id="47253">
            <id>47253</id>
            <state>1</state>
            <price>75</price>
            <exc_price>4500</exc_price>
</template>
</templates>
where state = 1 and id > 10

thanks
0
Comment
Question by:ethar1
  • 2
  • 2
4 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 39705788
have an identity transform with two specialised templates

<xsl:template match="template[state = 1 and id > 10]">
   <xsl:copy-of select="."/>
</xsl:template>

<xsl:template match="template[not(state = 1) or not(id > 10)]"/>
0
 

Author Comment

by:ethar1
ID: 39705856
could you please tell me how to remove xmlns:fo="http://www.w3.org/1999/XSL/Format"
from
<price xmlns:fo="http://www.w3.org/1999/XSL/Format">
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 39705863
by adding this in the stylesheet element as attributes
xmlns:fo="http://www.w3.org/1999/XSL/Format"
exclude-result-prefixes="fo"
0
 

Author Comment

by:ethar1
ID: 39705873
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now