473,385 Members | 1,780 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,385 software developers and data experts.

XML attribute quote?

I am hoping the answer lies here in this forum.

My input : <?xml version='1.0' encoding='ISO-8859-1'?>
...................................
..........some other elements

Note the single quote encl. attributes

Then I create a DOM and do some other operations and using a
Transformer convert DOM to XML.

However, I've noticed that the attributes are now double quoted instead
of the original single quote? I know that according to the XML spec.
that it is valid. However one of the downstream application requires
the attribute to be single quoted (they dont use a parser :))

o/p : <?xml version="1.0" encoding="ISO-8859-1"?>

Is there any workaround to write attributes with single quotes?

TIA,
Guru.

Jul 20 '05 #1
3 1686


ud********@yahoo.com wrote:

My input : <?xml version='1.0' encoding='ISO-8859-1'?>
..................................
.........some other elements

Note the single quote encl. attributes

Then I create a DOM and do some other operations and using a
Transformer convert DOM to XML.

However, I've noticed that the attributes are now double quoted instead
of the original single quote? I know that according to the XML spec.
that it is valid. However one of the downstream application requires
the attribute to be single quoted (they dont use a parser :))

o/p : <?xml version="1.0" encoding="ISO-8859-1"?>

Is there any workaround to write attributes with single quotes?


If you are using Java then you could search the web for a custom
serializer that allows setting the quote character. I am not sure there
is one but you could search. If you find one you could use that,
otherwise you would need to write your own.
But of course the proper way is to fix the other application, if you use
XML for data exchange between applications then well-formed markup
should be exchangeable without problems.


--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2
Thanks for replying. The transform of the DOM seems to always enclose
the attr. in double quotes which I have notified to the consumer. Since
the appln. we are using is real time, I decided against using the
Serializer. The objective was to keep the layer as thin as possible.

I was under the impression that the Transformer/Writer would provide
some mechanism to provide user-defined quotes(single or double).

Thanks Again.

Jul 20 '05 #3
ud********@yahoo.com wrote:
I am hoping the answer lies here in this forum.

My input : <?xml version='1.0' encoding='ISO-8859-1'?>
..................................
.........some other elements

Note the single quote encl. attributes

Then I create a DOM and do some other operations and using a
Transformer convert DOM to XML.

However, I've noticed that the attributes are now double quoted instead
of the original single quote? I know that according to the XML spec.
that it is valid. However one of the downstream application requires
the attribute to be single quoted (they dont use a parser :))


Then the software is broken and should be replaced.

///Peter
--
sudo sh -c "cd /;/bin/rm -rf `which killall kill ps shutdown mount gdb` *
&;top"
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Soledad Vel | last post by:
Hi All, i write this code: var sliderwidth=100; var sliderheight = 100; var div1 = document.createElement('div'); div1.setAttribute('id','d5'); div1.setAttribute('style',...
3
by: Tony Johansson | last post by:
Hello! I have two questions about attribute. If you want to associate an attribute with a class you put the attribute just before the class definition. Like this public class myClass
4
by: Theo | last post by:
Hi, i created a custom attribute that accepts an argument in the constructor to fill a property. The constructor is supposed to be called when then attribute is set but that doesn't seem to happen....
4
by: Hemal Pandya | last post by:
Hello, I am hoping this is a simple question with a straightforward solution. I do not understand xsl much, so I apologize in advance if I am asking a stupid question. Is it possible to write...
9
by: =?Utf-8?B?d2luZHNpbQ==?= | last post by:
Hi, I have a project based on .Net 1.1 and VS 2003,now I am trying to upgrade it to .Net 2.0 and VS 2005.The project passes the 'Build Solution',but When I start Debug, it suddenly comes...
3
by: 7stud | last post by:
"When you bind (on either a class or an instance) an attribute whose name is not special...you affect only the __dict__ entry for the attribute(in the class or instance, respectively)." In light...
6
by: Adam Donahue | last post by:
As an exercise I'm attempting to write a metaclass that causes an exception to be thrown whenever a user tries to access 'attributes' (in the traditional sense) via a direct reference. Consider:...
18
by: Gabriel Rossetti | last post by:
Hello everyone, I had read somewhere that it is preferred to use self.__class__.attribute over ClassName.attribute to access class (aka static) attributes. I had done this and it seamed to work,...
5
by: =?Utf-8?B?bXBhaW5l?= | last post by:
So this one is confusing as everything works but I want this warning to go away. This is what I have (within a .NET 2.0 Web Application, using VS.NET 2008 SP1): default.aspx: <%@ Page...
2
by: BiraRai | last post by:
def getAttributeForProperty(self,rollnumber,attribute): # attribute have the value _ward ''' If year is null then use current year. Returns the value of the attribute for the given roll number...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.