Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 28th, 2008, 09:49 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 109
Thanks: 18
Thanked 0 Times in 0 Posts
Default DTD Notation, specificlly <!ENTITY> refs

Hi,

I have both "XPATH 2.0" and "XSLT 2.0" and I've looked for this information, but I'm coming up dry.

I am given the task of working with XML files that must be able to round-trip to Adobe's Structured Framemaker.

For the most part this is not a problem, but the XML generated from Framemaker has a <!DOCTYPE Section [...]>. Inside this section are a <!NOTATION cgm SYSTEM ""> and several <!ENTITY Figure SYSTEM "FigureID.cgm" NDATA cgm> entries.

I'm not sure why FM is using this method for including graphics files and other external files, but they are.

My problem is, I bring in one of these files, do some restructuring work but I'm not able to write it out with the <!DOCTYPE Section...> intact.

The way FM does Cross References is equally as bad, they use <?FM MARKER [Cross-Ref]....?> constructs.

So, writing my modified XML back out so it can be imported into FM is not working because all of these constructs are not being written in the file.

Is these something I need to do so I can work with these constructs?

Thanks,

- m

------------------------
GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876

Michael Hare
__________________
------------------------
Keep Moving Forward

GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876

Michael Hare
 
Old April 28th, 2008, 10:02 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

The <?FM ...?> is called a processing-instruction, and can be written out in XSLT using <xsl:processing-instruction>

e.g.:

<xsl:processing-instruction name="FM">MARKER [Cross-Ref]...</xsl:processing-instruction>

http://www.w3schools.com/xsl/el_proc...nstruction.asp

Entity declarations are not part of the standard XSLT instruction set, but some processors provide extra functionality to output this information.

e.g. Saxon: http://www.saxonica.com/documentatio...s/doctype.html

/- Sam Judson : Wrox Technical Editor -/
 
Old April 28th, 2008, 01:10 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 109
Thanks: 18
Thanked 0 Times in 0 Posts
Default

Thanks Sam, that helped a lot.

Now, is there a way in Saxon to read all the DocType information from the source document?

unparsed-entity-public-id() and unparsed-entity-uri() do not seem to able to read unknown entities.

------------------------
GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876

Michael Hare
 
Old April 29th, 2008, 08:57 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Unparsed entities aren't widely used and aren't well supported by XSLT. You may find the saxon:doctype extension helpful. Alternatively some people try to generate the DTD of an output document "by hand" using disable-output-escaping.

A better way might be to generate the information needed in the form of regular elements and attributes, and then post-process the output through a SAX filter that converts these elements and attributes into the required DTD constructs.

Processing instructions like <?FM MARKER [Cross-Ref]....?> are fully supported by XSLT and shouldn't cause any difficulty.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Processing ENTITY and NOTATION lines in xml mrame XSLT 2 August 1st, 2008 01:24 PM
ENTITY AND NOTATION IN XSLT mrame XSLT 5 July 29th, 2008 04:28 PM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 08:50 AM
<marquee><b>About CHAT App. in PHP4</b></marquee> Ramkrishna PHP How-To 1 September 11th, 2004 07:01 AM
<STRONG> vs <B> and <EM> vs <I> anshul HTML Code Clinic 12 September 1st, 2004 05:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.