Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Get a carriage return in empty elements .net xmltransform

Posted on 2004-10-28
4
Medium Priority
?
319 Views
Last Modified: 2008-02-01
Is there any way around this short of telling the xmlwriter not to indent?
I have a process that send an xml doc to a cust who changes some data and
returns it.  It gets rejected on the resubmit because of the problem below.

I have an xslt trans. I am transforming it with the .net transformation
object when it hits an empty element it reurns something like this.
<email>
  </email>
instead of
<email></email> or <email/>

the .net objects seems to ignore  <xsl:strip-space elements="*" />.



0
Comment
Question by:kpejr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 4

Assisted Solution

by:andrewharris
andrewharris earned 1000 total points
ID: 12439220
Apart from the fact that it is ignoring your strip-space directive you could possibly run a replace on "> </" with "></" it is definately a work around but the best I could think of short term.

Andrew
0
 
LVL 6

Accepted Solution

by:
etmendz earned 1000 total points
ID: 12441801
In your XSLT, try to write the code that transforms for <email> in one line. That is for example:

<email><xsl:value-of select="."></email>

Have fun.
0
 

Author Comment

by:kpejr
ID: 12444344
I tried the replace before, the problem is you would have to parse before you replaced or it replaces the cr after and end tag for a block as well as the ones you want to replace.

I just tried <email><xsl:value-of select="."></email> and it still adds the cr.

0
 

Author Comment

by:kpejr
ID: 12472821
Figured it out. You have to inherit the xmltextwriter and override WriteFullEndElement with this:

    Public Overrides Sub WriteFullEndElement()
        MyBase.WriteEndElement()
    End Sub
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question