RE: Using xsl Stylesheet - html view
Posted: Sat Nov 15, 2003 2:24 am
Dear George,
Thank you very much for your help and your patience.
It is still not working and I am a short time away to give it up forever...
I will send you now all my written code, this is the last possibility.
My Test1.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="Test1.xsl"?>
<root:Bilddatenbank xmlns:root="http://www.w3.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org Test1.xsd">
<!--I have to write root:Bilddatenbank without the root: it does not work and this is something I didn't understand either! -->
<Patient>
<Name>Blatt</Name>
<Vorname>Marc</Vorname>
</Patient>
</root:Bilddatenbank>
My Test1.xsd
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace="http://www.w3.org">
<xs:element name="Bilddatenbank">
<xs:complexType>
<xs:sequence>
<xs:element name="Patient" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Vorname">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
My Test1.xsl:
<?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>
<body bgcolor="#CCFFFF">
<h1 align="center">
Bilderdatenbank
</h1>
<p>
<h2>
<xsl:value-of select="Bilddatenbank/Patient/Name"/>
<!--Only the last name Blatt should appear in the html file but nothing appears
I have no idea why!-->
</h2>
</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
And what about the <xsl:apply-templates>? Do I need that? If I put this in the body I can see all the data in html but I can't select.
Thank you for your help.
Marc
Thank you very much for your help and your patience.
It is still not working and I am a short time away to give it up forever...
I will send you now all my written code, this is the last possibility.
My Test1.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="Test1.xsl"?>
<root:Bilddatenbank xmlns:root="http://www.w3.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org Test1.xsd">
<!--I have to write root:Bilddatenbank without the root: it does not work and this is something I didn't understand either! -->
<Patient>
<Name>Blatt</Name>
<Vorname>Marc</Vorname>
</Patient>
</root:Bilddatenbank>
My Test1.xsd
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace="http://www.w3.org">
<xs:element name="Bilddatenbank">
<xs:complexType>
<xs:sequence>
<xs:element name="Patient" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Vorname">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
My Test1.xsl:
<?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>
<body bgcolor="#CCFFFF">
<h1 align="center">
Bilderdatenbank
</h1>
<p>
<h2>
<xsl:value-of select="Bilddatenbank/Patient/Name"/>
<!--Only the last name Blatt should appear in the html file but nothing appears
I have no idea why!-->
</h2>
</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
And what about the <xsl:apply-templates>? Do I need that? If I put this in the body I can see all the data in html but I can't select.
Thank you for your help.
Marc