Using xsl Stylesheet - html view
Having trouble installing Oxygen? Got a bug to report? Post it all here.
Using xsl Stylesheet - html view
Post by Marc »
Hi @ all,
I still have a big problem. I want to use a stylesheet to view my xml in html. My xsl looks like that:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title> My Database </title>
</head>
<body>
<h2>
<xsl:value-of select="database/Patient/Name"/>
</h2>
<h1> My Database </h1>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
The following line is not working:
<xsl:value-of select="database/Patient/Name"/>
The html-doc does not show the "name", why?!?
My xsd looks like that:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<xs:element name="database">
<xs:complexType>
<xs:sequence>
<xs:element name="Patient">
<xs:complexType>
<xs:sequence>
<xs:element name="Name">
<xs:simpleType>
...
Do you have an indea?
Thank you very much for help!
Marc
I still have a big problem. I want to use a stylesheet to view my xml in html. My xsl looks like that:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title> My Database </title>
</head>
<body>
<h2>
<xsl:value-of select="database/Patient/Name"/>
</h2>
<h1> My Database </h1>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
The following line is not working:
<xsl:value-of select="database/Patient/Name"/>
The html-doc does not show the "name", why?!?
My xsd looks like that:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<xs:element name="database">
<xs:complexType>
<xs:sequence>
<xs:element name="Patient">
<xs:complexType>
<xs:sequence>
<xs:element name="Name">
<xs:simpleType>
...
Do you have an indea?
Thank you very much for help!
Marc
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi Marc,
Please note that the view embedded in oXygen is for XHTML and not for HTML therefore if you want to use that you might consider setting the output method to XML:
Applying this stylesheet on
gives the expected result:
<?xml version="1.0" encoding="UTF-8"?>
<html><head><title> My Database </title></head><body><h2>person</h2><h1> My Database </h1></body></html>
If you still have problems then I guess the problem is your input document. In this case please post a cut down sample of that document to allow us to reproduce the problem.
Best Regards,
George
Please note that the view embedded in oXygen is for XHTML and not for HTML therefore if you want to use that you might consider setting the output method to XML:
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>
<xsl:template match="/">
<html>
<head>
<title> My Database </title>
</head>
<body>
<h2>
<xsl:value-of select="database/Patient/Name"/>
</h2>
<h1> My Database </h1>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<database>
<Patient>
<Name>person</Name>
</Patient>
</database>
<?xml version="1.0" encoding="UTF-8"?>
<html><head><title> My Database </title></head><body><h2>person</h2><h1> My Database </h1></body></html>
If you still have problems then I guess the problem is your input document. In this case please post a cut down sample of that document to allow us to reproduce the problem.
Best Regards,
George
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