trouble styling xml with xsl

This is a discussion on trouble styling xml with xsl within the Tech Board forums, part of the Community Boards category; I've got an xml file Code: <?xml version="1.0" standalone="yes"?> <?xml-stylesheet type="text/xsl" href="corporation.xsl"?> <!DOCTYPE Corporation [ <!ELEMENT Corporation (name, employee, location)> ...

  1. #1
    Registered User
    Join Date
    Apr 2010
    Location
    Vancouver
    Posts
    127

    trouble styling xml with xsl

    I've got an xml file
    Code:
    <?xml version="1.0" standalone="yes"?>
    <?xml-stylesheet type="text/xsl" href="corporation.xsl"?>
    <!DOCTYPE Corporation [
    <!ELEMENT Corporation (name, employee, location)>
    <!ELEMENT name (#PCDATA)>
    <!ELEMENT employee EMPTY>
    	<!ATTLIST employee name CDATA #REQUIRED>
    	<!ATTLIST employee id_number CDATA #REQUIRED>
    	<!ATTLIST employee email CDATA #REQUIRED>
    	<!ATTLIST employee phonenumber CDATA #IMPLIED>
    <!ELEMENT location EMPTY>
    	<!ATTLIST location postal_code CDATA #REQUIRED>
    	<!ATTLIST location city CDATA #REQUIRED>
    	<!ATTLIST location province CDATA #REQUIRED>
    	<!ATTLIST location address CDATA #REQUIRED>
    	<!ATTLIST location size CDATA #IMPLIED>
    ]>
    
    <Corporation>
    <name>Scott's Company</name>
    <employee name="Scott" id_number="34C23a" email="fake@example.com" phonenumber="2503358293" />
    <location postal_code="A1B 2C3" city="Victoria" province="B.C." address="2530 Broadway" size="20" />
    </Corporation>
    I've got an xsl file

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
    <xsl:template match="/">
    	<!DOCTYPE html>
    		<html lang="en">
    			<head>
    			<meta charset="utf-8" />
    			<title>Sample Corporation #1</title>
    		</head>
    		<body>
    		Hello this is a test<br />
    		Have a great day!
    		</body>
    	</html>
    </xsl:template>
    
    </xsl:stylesheet>
    and Firefox gives me "XML Parsing Error: not well-formed
    Location: file:///E:/XSLT-XML-Shema/corporation.xsl
    Line Number 6, Column 4: <!DOCTYPE html>
    ----------^"
    Last edited by c_weed; 06-12-2011 at 04:34 PM. Reason: changed xsl

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Trouble with eof()
    By waterborne in forum C++ Programming
    Replies: 3
    Last Post: 06-23-2010, 04:54 PM
  2. Trouble with I/O
    By Dae in forum C++ Programming
    Replies: 15
    Last Post: 07-03-2005, 10:10 PM
  3. trouble
    By firefly in forum C++ Programming
    Replies: 4
    Last Post: 06-28-2005, 05:21 PM
  4. Trouble
    By The New Guy in forum C Programming
    Replies: 2
    Last Post: 01-28-2003, 06:02 AM
  5. trouble
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 05-25-2002, 05:47 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21