Solved

generate xml from xsl using xsl

Posted on 2013-12-09
4
264 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How can i generate these XML with SimpleXML() 5 74
AL3 Files 4 29
JQuery to parse xml string and get element by id 4 35
SQL Result Set to XML 4 36
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 …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

778 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