473,387 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Outputing & on XML

5
I'm using XSLT to process an inbound xml file and wanted to translate all the ģ to ® but it's not allowing me to put in a & symbol. When I use ® it's outputing &reg. How can I get the output to format correctly?
Thanks.
Nov 23 '09 #1
9 3291
Dormilich
8,658 Expert Mod 8TB
either allow ® by writing it in the DTD or use its numeric entity.

PS. there are only 5 named entities defined by default in XML
Nov 23 '09 #2
flin2k
5
When I tried to write the ® to the output xml file with the following statement:
<xsl:with-param name="charsOut" select="'&reg;'"/>

oXygen complained that the entity "reg" was not declared. Then I try to change the "&" to &amp; as follow:
<xsl:with-param name="charsOut" select="'&amp;reg;'"/>
<xsl:with-param name="charsOut" select="'&reg;'"/> (I also try this but same result).

the output became CompanyName&amp;reg;


what I need is for the output xml to look like CompanyName&reg; How can I get this done?

Thanks.
Nov 23 '09 #3
Dormilich
8,658 Expert Mod 8TB
@flin2k
that is correct behaviour so far.

@flin2k
see post above.
Nov 23 '09 #4
flin2k
5
Is there a way to force the text "&reg;" to the outbound xml file?
Nov 24 '09 #5
Dormilich
8,658 Expert Mod 8TB
yes, and I have already told you, how to do it.
Nov 24 '09 #6
flin2k
5
I'm VERY new at this and don't understand what you mean by use its numeric entity or DTD? Any reference I can look up?
Thanks.
Nov 24 '09 #7
Dormilich
8,658 Expert Mod 8TB
letís try some keywords (in wikipedia)
named entity
numeric entity
DTD
XSD
XML
XML Specification
Nov 24 '09 #8
flin2k
5
If I read this correctly, I cannot use the "&" character directly so I'll need to use the predefined code "&amp;" thus when I coded the xsl as select="'&amp;reg;" shouldn't the translation from "&amp;" to "&" take place when output is generated? what am I missing?

Thanks.
Nov 24 '09 #9
Dormilich
8,658 Expert Mod 8TB
@flin2k
correct

@flin2k
not correct, there are 2 other ways to escape & (or ģ)*

@flin2k
nope, the substitution is done on screen (i.e. the representation changes), but the &amp; will remain as is in the source code.

@flin2k
link No. 2

* - compare what you see as this postís text with what you see in its source code
Nov 24 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: bissatch | last post by:
Hi, I have the following XML content in a file (main.xml): <?xml version="1.0" encoding="iso-8859-1"?> <menu> <option title="Home" href="home.php"> <option title="News" href="news.php">...
2
by: Antonio Ooi | last post by:
Hi, Probably due to my 'Language for non-Unicode Setting' in Regional Settings, my ASP page keeps outputing the date format as Chinese Simplified characters when issuing say, <%=Now()%>. In...
1
by: DrTebi | last post by:
Hello, I have the following problem: I used to "encode" my email address within links, in order to avoid (most) email spiders. So I had a link like this: <a...
0
by: Thomas Scheffler | last post by:
Hi, I runned in trouble using XALAN for XSL-Transformation. The following snipplet show what I mean: <a href="http://blah.com/?test=test&amp;test2=test2">Test1&amp;</a> <a...
4
by: johkar | last post by:
When the output method is set to xml, even though I have CDATA around my JavaScript, the operaters of && and < are converted to XML character entities which causes errors in my JavaScript. I know...
0
by: Paul Hatcher | last post by:
I have some input data that's already been processed and might contain XML encoded characters e.g. &#x20;. the problem is that the XmlTextWriter automatically escapes the & to &amp; giving &amp;x20; in the...
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
4
by: jdcrief | last post by:
Using Visual C++2005 Expression Edition Having trouble outputting the value referenced by the pointer and then outputing the address of the pointer for the char. Any ideas would be greatly...
8
by: Jon Slaughter | last post by:
can one "stream" image data to a browser? I created an image using gd and when I do imagepng I just get the binary data for the image written as text instead of the image itself. Now I'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.