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

Empty elements created with an XmlTextWriter

I am using an XmlTextWriter to create an XML document, which we then send to
a client. The document is failing to validate against the DTD we are
providng when the load it into their (non-Microsoft) application, despite it
validating fine in VB.NET.

I believe we may have tracked the issue down to the way their software is
interpreting empty elements. When the element is written like this:

\\\
[...]
<SomeElement />
[...]
///

....the validation fails. However, if we write the element as:

\\\
[...]
<SomeElement></SomeElement>
[...]
///

.... the validation succeeds.

Is there a way of getting the XmlTextWriter to automatically produce "long"
empty elements like in my second example?

Many thanks,

--

(O)enone
Nov 23 '05 #1
2 4256
"Oenone" <oe****@nowhere.com> schrieb:
I am using an XmlTextWriter to create an XML document, which we then send
to a client. The document is failing to validate against the DTD we are
providng when the load it into their (non-Microsoft) application, despite
it validating fine in VB.NET.
[...]
\\\
[...]
<SomeElement />
[...]
///

...the validation fails. However, if we write the element as:

\\\
[...]
<SomeElement></SomeElement>
[...]
///

... the validation succeeds.

Is there a way of getting the XmlTextWriter to automatically produce
"long" empty elements like in my second example?


You may want to use the 'XmlTextWriter''s 'WriteFullEndElement' method to
prevent it from emitting a short end tag.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 23 '05 #2
Herfried K. Wagner [MVP] wrote:
Is there a way of getting the XmlTextWriter to automatically produce
"long" empty elements like in my second example?


You may want to use the 'XmlTextWriter''s 'WriteFullEndElement'
method to prevent it from emitting a short end tag.


Perfect -- as usual, thanks very much for your assistance.

--

(O)enone
Nov 23 '05 #3

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

Similar topics

23
by: Mikko Ohtamaa | last post by:
From XML specification: The representation of an empty element is either a start-tag immediately followed by an end-tag, or an empty-element tag. (This means that <foo></foo> is equal to...
4
by: T Conti | last post by:
Howdy: I am currently writing a .Net handler to replace an ASP page. The ASP module used a COM dll to format XML. This dll was pretty robust and it auto-suppressed empty elements and...
1
by: Geir Sørensen | last post by:
Hi, When I transform an xml-file using XslTransform, I seem to get a lot of elements of this form: <a> </a> <b> </b> But I really would like to get written out like I do when transforming...
3
by: Clark Spencer | last post by:
I have built a small integration app using VS .NET 2003 that extracts orderinformation from a 'webshop'. Extracting the orderinformation works fine. Appending the order elements in the...
11
by: Dica | last post by:
i'm getting an error about 'the process cannot access the file becaise it is being used by another process.' write after i've created a new file and try to open it for writing with xmlTextWriter....
1
by: st | last post by:
Hi, I've a routine that exports a DB query to Excel by building an XmlDocument and saving to a XmlTextWriter. I'm having trouble with carriage returns in a mailing address not showing up in the...
2
by: quest | last post by:
I created xml file using XmlTextWriter. When I opened the xml file using binary editor, the first 3 bytes of the xml file consist of EF, BB, BF respectively. Is there any way I can generate the XML...
5
by: wolf_y | last post by:
My question is simply: under what conditions will empty tags of the form <MOM></MOM> pass schema validation? Of course, the mirror question is: under what conditions will empty tags fail...
7
by: MaxMax | last post by:
I want to insert a white line between XML elements to raise human readability example: <MyNode> </MyNode> <MyNode> </MyNode>
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.