Hot to export xpath search
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 1
- Joined: Thu Feb 11, 2016 8:00 am
Hot to export xpath search
How do I export the nodes of my search:
so here is my example xml:
my xpath:
now what I want is the possibility to export the search this way, would be easy to hand manually was not for the case that my xml has 3.500.000 lines
so here is my example xml:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<notes version="1">
<note player="morgan" label="7" update="1">content</note>
<note player="jack" label="12" update="1">content</note>
<note player="jon" label="32" update="2">content</note>
<note player="mr rain" label="12" update="2">content</note>
<note player="mr forest" label="32" update="3">content</note>
</notes>
Code: Select all
/notes/note[@update>=2]

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<notes version="1">
<note player="jon" label="32" update="2">content</note>
<note player="mr rain" label="12" update="2">content</note>
<note player="mr forest" label="32" update="3">content</note>
</notes>
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Hot to export xpath search
Hi,
Maybe you can create an XSLT stylesheet with the content something like:
then create a transformation scenario in Oxygen and apply it over the XML.
Regards,
Radu
Maybe you can create an XSLT stylesheet with the content something like:
Code: Select all
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>
<!-- Match document -->
<xsl:template match="/">
<xsl:apply-templates mode="copy" select="."/>
</xsl:template>
<!-- Deep copy template -->
<xsl:template match="*|text()|@*" mode="copy">
<xsl:copy>
<xsl:apply-templates mode="copy" select="@*"/>
<xsl:apply-templates mode="copy"/>
</xsl:copy>
</xsl:template>
<xsl:template match="note[@update < 2]" mode="copy">
<!-- Ignore content of notes which have the update value less than 2 -->
</xsl:template>
<!-- Handle default matching -->
<xsl:template match="*"/>
</xsl:stylesheet>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service