text to xml
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 147
- Joined: Sat Oct 19, 2013 8:21 am
text to xml
Hi,
I have text file contains information :
I use xml file :
I use file xsl in V2
I obtains in result :
My question : how do to remove information xmlns:xs="http://www.w3.org/2001/XMLSchema" and xmlns:fo="http://www.w3.org/1999/XSL/Format" in file result
Thank you for help
I have text file contains information :
Code: Select all
The design of the Darwin Information Typing Architecture (DITA)
This specification describes specific details of each element in the OASIS DITA language.
The elements that make up the DITA design represent a set of different authoring concerns
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<document/>
Code: Select all
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:output encoding="UTF-8" indent="yes"/>
<xsl:template match="document">
<xsl:variable name="inputText"
select="unparsed-text(resolve-uri('input.txt',base-uri(/)),'UTF-8')"/>
<xsl:copy>
<xsl:analyze-string select="$inputText" regex="\n">
<xsl:non-matching-substring>
<p><xsl:value-of select="."/></p>
</xsl:non-matching-substring>
</xsl:analyze-string>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<document>
<p xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fo="http://www.w3.org/1999/XSL/Format">The design of the Darwin Information Typing Architecture (DITA)</p>
<p xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fo="http://www.w3.org/1999/XSL/Format">This specification describes specific details of each element in the OASIS DITA language.</p>
<p xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fo="http://www.w3.org/1999/XSL/Format">The elements that make up the DITA design represent a set of different authoring concerns</p>
</document>
Thank you for help
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: text to xml
Hi,
You have to explicitly mention the namespace prefixes that should be excluded from the output.
Add this attribute to the xsl:stylesheet root element:
Regards,
Adrian
You have to explicitly mention the namespace prefixes that should be excluded from the output.
Add this attribute to the xsl:stylesheet root element:
Code: Select all
exclude-result-prefixes="xs fo"
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
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