?
Solved

generate xml from xsl using xsl

Posted on 2013-12-09
4
Medium Priority
?
270 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 2000 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

Featured Post

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

770 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