Solved

generate xml from xsl using xsl

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

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…
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

791 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