XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Mike PragerSubject: Indent XML Tags only partially working
Author: Mike Prager
Date: 04 Jan 2013 11:28 AM
Hi,

I have an XML file that we get from a customer. If I indent XML tags, everything works apart from lines where there is an element with text in it. For these lines, all elements after this one appear on the same line and are not indented i.e.

<Test>
<Node>Some text in here<ThenAnotherNode>Something</ThenAnotherNode><AnAnotherNode>WithSomething</AnAnotherNode></Node>
</Test>

when indented,everything from <Node> onwards is not indented whereas if I remove the text, it works fine,

<Test>
<Node>
<ThenAnotherNode>Something</ThenAnotherNode>
<AnAnotherNode>WithSomething</AnAnotherNode>
</Node>
</Test>

Any idea how I can indent these lines?

Many thanks

Mike


Posttop
Ivan PedruzziSubject: Indent XML Tags only partially working
Author: Ivan Pedruzzi
Date: 04 Jan 2013 07:36 PM
Hi Mike,

Th Stylus Studio XML Indenter does not change element with mixed content.

As workaround you can process your XML document using the following style-sheet

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>

<xsl:template match="/">
<xsl:copy-of select="/"/>
</xsl:template>

</xsl:stylesheet>


Hope this helps
Ivan Pedruzzi
Stylus Studio Team

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.