Question How to skip to the next line end element in XML

trmrahim

New Member
How to skip to the next line end element in XML ? (refer Expect result)

When open it from the browser it's looks fine but when you open from notepad/wordpad/XML marker it shows as below (Actual Result).

Actual Result,
<customers>
<customer>
<SalesRep>1</SalesRep></customer>
<customer>
<SalesRep>2</SalesRep></customer>
<customer>
<SalesRep>3</SalesRep></customer>
<customer>
<SalesRep>4</SalesRep></customer>
</customers>

Expect result,

<customers>
<customer>
<SalesRep>1</SalesRep>
</customer>
<customer>
<SalesRep>2</SalesRep>
</customer>
<customer>
<SalesRep>3</SalesRep>
</customer>
<customer>
<SalesRep>4</SalesRep>
</customer>
</customers>
 

TomBascom

Curmudgeon
In this case I skipped to the next line by moving my gaze down one line.

If you showed some code someone might have a suggestion more apropos to programming. If that's what you are after.
 

Stefan

Well-Known Member
Whitespace should be irrelevant for a standards compliant xml parser. You do not specify how you are creating your xml:

1. write-xml
2. sax-writer
3. x-document
4. manually

ABL Dojo
 

avtarjain

New Member
Why do you want </customer> in next line? May be we can think of different solution if Root problem is better understood. From schema point of view, both are Well formed.
 

ForEachInvoiceDelete

Active Member
i "think" your issue with how the XML looks in your editor(In your case, WordPad/NotePad), and nothing to do with its creation or use.

I use a plugin for Notepad ++ called "XML Tools" that has a Pretty Print option. Turns your XML into

Code:
<customers>
    <customer>
        <SalesRep>1</SalesRep>
    </customer>
    <customer>
        <SalesRep>2</SalesRep>
    </customer>
    <customer>
        <SalesRep>3</SalesRep>
    </customer>
    <customer>
        <SalesRep>4</SalesRep>
    </customer>
</customers>

Notepad++ Plugins - Browse /XML Tools at SourceForge.net <-- link to the plugin
 
Top