Solved

generate xml from xsl using xsl

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Detect file exist or not 3 203
MS SQL Database Generating XML using query 21 58
MS Access XML Export Query Setup Multiple Tag Values 15 43
XML Removal- Powershell 4 34
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…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

726 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