[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: doctype decl problem

Subject: Re: doctype decl problem
From: Chris Lilley <chris@xxxxxx>
Date: Fri, 03 Mar 2000 13:54:28 +0100
doctype svg system

"Pawson, David" wrote:
> 
> I'm trying to transform an SVG document and getting
> totally screwed up with the decl.
> 
> If I understand it right, an xml decl can have a public identifier,
> but then must have a system identifier as well.
> 
> So I cant (as in SGML) say
> 
> <?xml version = "1.0" ?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 03December 1999//EN" >

You have there a prolog, which consists of two things, an xml declaration,
followed by a doctype declaration. It is the latter which has a public and
optionally a system identifier.

[22] prolog  ::=   XMLDecl? Misc* (doctypedecl Misc*)?

> Instead I must say
> 
> <?xml version = "1.0" ?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 03December 1999//EN" SYSTEM
> "http://www.w3.org/Graphics/SVG/SVG-19991203.dtd">

If you remove the SYSTEM bit from that example

[28]  doctypedecl  ::=   '<!DOCTYPE' S Name (S ExternalID)? S? ('['
                          (markupdecl | PEReference | S)* ']' S?)? '>'

[75] ExternalID  ::=  'SYSTEM' S SystemLiteral
                       | 'PUBLIC' S PubidLiteral S SystemLiteral 


> 1. Am I correct in my understanding?
> ( http://www.w3.org/TR/REC-xml#sec-prolog-dtd )

Close but not quite.

> Either way, I have a file which when used with the above prolog shortened to
> 
> <?xml version = "1.0" ?>
> <!DOCTYPE svg  SYSTEM "path/to/myLocalCopyOf/SVG-19991203.dtd">
> 
> No element below the root is triggering any of the templates....
> To be exact, <xsl:template match= "/"> is triggering,
> but the outer container, <svg> is not triggering.

Do your templates check for svg in the SVG namespace, or just any svg
element?
> 
> I checked with Ken Holmans showtree and got a load of 'empty' triggers.
> 
> However... when I remove the doctype line,
> my templates trigger quite happily.
> 
> E.g.
> 
> <?xml version = "1.0" ?>
> <svg x="0" y="0" width="2523.895996" height="667.296005">

You don't have a namespace declaration. You should, for standalone files.
Notice, if you follow the link to the DTD, that it says (among other
things)

<!ATTLIST svg
  xmlns CDATA #FIXED 'http://www.w3.org/Graphics/SVG/SVG-19991203.dtd'

For a standalone document you need to have the namespace or namespaces (SVG
also uses the XLink namespace) declared explicitly.

> When I insert
> <!DOCTYPE svg SYSTEM "../w3c/svg-19991203.dtd">
> Nothing other than the / template triggers.

What about if you use

<?xml version = "1.0" ?>
<svg xmlns="http://www.w3.org/Graphics/SVG/SVG-19991203.dtd"
  x="0" y="0" width="2523.895996" height="667.296005">
and so on
</svg>

--
Chris


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.