What is the error? Please Help
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 2
- Joined: Mon Apr 27, 2009 8:27 am
What is the error? Please Help
Hi all,
I am a beginner learning XML.
I have created the following XSL file:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org" version = "1.0">
<xsl:template match = "/">
<xsl:for-each select = "MARKS/CORE">
<xsl:text>MARK IN SUBJECT 1</xsl:text>
<xsl:value-of select = "M1"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
And the following XML file :
<?xml version ="1.0"?>
<?xml-stylesheet type="text/xsl" href = "Trial.xsl"?>
<MARKS>
<CORE>
<M1>100</M1>
<M2>90</M2>
</CORE>
<ALLIED>
<M3>100</M3>
<M4>100</M4>
</ALLIED>
</MARKS>
But when I run the above file in the browser it is just displaying the text "Mark in Subject 1" but the value of m1 is not displayed can any one identify the changes I should make to get the correct output.
Please help me out.
Thanks in advance!
I am a beginner learning XML.
I have created the following XSL file:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org" version = "1.0">
<xsl:template match = "/">
<xsl:for-each select = "MARKS/CORE">
<xsl:text>MARK IN SUBJECT 1</xsl:text>
<xsl:value-of select = "M1"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
And the following XML file :
<?xml version ="1.0"?>
<?xml-stylesheet type="text/xsl" href = "Trial.xsl"?>
<MARKS>
<CORE>
<M1>100</M1>
<M2>90</M2>
</CORE>
<ALLIED>
<M3>100</M3>
<M4>100</M4>
</ALLIED>
</MARKS>
But when I run the above file in the browser it is just displaying the text "Mark in Subject 1" but the value of m1 is not displayed can any one identify the changes I should make to get the correct output.
Please help me out.
Thanks in advance!
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
Re: What is the error? Please Help
For a good XSLT tutorial, please see:
http://www.zvon.org/xxl/XSLTutorial/Output/index.html
Best regards,
Dan
http://www.zvon.org/xxl/XSLTutorial/Output/index.html
Best regards,
Dan
-
- Posts: 2
- Joined: Mon Apr 27, 2009 8:27 am
Re: What is the error? Please Help
Dan wrote:For a good XSLT tutorial, please see:
http://www.zvon.org/xxl/XSLTutorial/Output/index.html
Best regards,
Dan
THANKS A LOT FOR PROVIDING THE LINK FOR THE TUTORIAL BUT CAN YOU FIND ANY ERROR IN THE XSL OR XML FILE WHICH I PROVIDED?
PLEASE HELP ME.
-
- Posts: 9507
- Joined: Fri Jul 09, 2004 5:18 pm
Re: What is the error? Please Help
Hi,
Your stylesheet does not correctly specify the XSLT namespace. It should be something like:
After that, everything should work fine.
Regards,
Radu
Your stylesheet does not correctly specify the XSLT namespace. It should be something like:
Code: Select all
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version = "1.0">
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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