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 July 28th, 2008, 02:16 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Default ENTITY AND NOTATION IN XSLT

Hi All,

I have an xml file extracted from a FrameMaker file.
This xml file acts as an input for my xslt file to generate another xml file.
The input xml file contains declarations for figure entities, with notation.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Section [
<!NOTATION cgm SYSTEM "">
<!ENTITY Figure1 SYSTEM "Figure11.cgm" NDATA cgm>
]>
<Section>
...
<Figure width = "9.000in" entity = "Figure1"/>
...
</Section>
Now on this input xml if I come thro' the <figure> element, I have to give link to that particular image file (Figure11.cgm), on output xml file. i.e, if I open the output xml file in FrameMaker, the Figure should be present in the <figure> place.

Any help is appreciated.

thanks,
rame

__________________
Rummy
 
Old July 28th, 2008, 02:57 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

This is what the rarely-used function unparsed-entity-uri() is for.

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference
 
Old July 28th, 2008, 05:05 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Default

Its working fine Mike. Thank you.

 
Old July 29th, 2008, 12:37 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Default

Mike, the above results in giving the whole path of the figure. But in FrameMaker an error arise like "Bad entity name". Is there any solution.
Or other way is that, its ok that the output contain the same input <Figure ....> tag and the DOCTYPE like one mentioned below.

<!DOCTYPE Root [
<!NOTATION cgm SYSTEM "">
<!ENTITY Figure1 SYSTEM "Figure1.cgm" NDATA cgm>
]>



 
Old July 29th, 2008, 01:17 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

The unparsed-entity-uri() function is defined to return the absolute URI of the resource, because its relative URI in general doesn't mean anything outside the context of the original source document. If you want to make it relative again (either to the original base URI or to some other base URI) then you'll have to do that work yourself.

I'm not sure where the "bad entity name" comes into it. You should be using the result where a URI is expected, not where an entity name is expected.

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference
 
Old July 29th, 2008, 04:28 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Default

Thanks Mike. I have cleared the ENTITY error by adding some templates.






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
DTD Notation, specificlly <!ENTITY> refs mphare XSLT 3 April 29th, 2008 08:57 PM
scientific notation pcase XSLT 1 January 9th, 2008 04:29 PM
Thousands and Decimals - Notation fskilnik Dreamweaver (all versions) 3 October 4th, 2005 02:35 PM
Difference between Entity and Entity type arshad mahmood C++ Programming 0 May 8th, 2004 12:34 AM





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