XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
siva ramanSubject: entity conversion
Author: siva raman
Date: 21 Mar 2005 01:59 AM
Hello All,

pls help me in entity conversion in xml to xml mapping.
I need the same entity name (e.g. –) should come in output xml file.
Now I am using a entity file (with unicode values) with my xslt and get symbols instead of entities.


thanks
Siva

Postnext
Ivan PedruzziSubject: entity conversion
Author: Ivan Pedruzzi
Date: 21 Mar 2005 04:36 PM

Could you post the XSLT + XML you are using?

Postnext
siva ramanSubject: entity conversion
Author: siva raman
Date: 22 Mar 2005 09:41 AM
Hai Ivan,

thanks for your reply.

Pls find the files, by which i am transforming xml to xml.



thanks
Siva


Unknowncheck.ent
entity

Unknownconvert.xsl
xsl

Unknowninput(2).xml
input

Postnext
Ivan PedruzziSubject: entity conversion
Author: Ivan Pedruzzi
Date: 22 Mar 2005 10:14 AM
Siva

to output a dtd declaration you have to use

<xsl:output method="xml" encoding="UTF-8" doctype-system="http://public.metapress.com/dtd/TAFXML/TFJA.dtd" indent="yes"/>


Postnext
siva ramanSubject: entity conversion
Author: siva raman
Date: 22 Mar 2005 10:27 AM
Ivan

thanks for ur reply,

can u pls send reply for regarding the entity conversion.
My requirement is entity name should be same as in input xml.


thanks
Siva

Posttop
Tony LavinioSubject: entity conversion
Author: Tony Lavinio
Date: 22 Mar 2005 11:56 AM
In any XSLT engine, you cannot see the original entities.
The XML parser converts them into Unicode code-points, so XSLT only
sees them that way.

If you want to emit them again as entities, you must do the work
yourself.

XSLT 2.0 has a mechanism for handling that; you can build character-maps
(see http://www.w3.org/TR/xslt20/#character-maps for details). But there
is no way in XSLT itself to say "I saw a &tm; come in, and I want to
write it out as a &tm;" because that's the job of the serializer, which
comes AFTER the XSLT is done with the transform.

If you know the specific code-points, you can manually replace them,
but again that's harder in XSLT 1.0 since there is no search-and-replace
function like there is in 2.0, but one can be simulated. For help on
that, I would probably recommend the XSLT Cookbook by Sal Mangano.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.