xsl-list
[Top] [All Lists]

Re: [xsl] [XSLT] Put element in new-line

2008-03-06 04:29:46
indent is not just new line - it is new line & spaces

in xslt 2.0 & push model is possible use (here maybe some extra lines
but it is all manageable
- here just sample

<xsl:template match="*" priority="999">
<xsl:text>
</xsl:text>
<xsl:next-match/>
<xsl:text>
</xsl:text>
</xsl:template>


On Thu, Mar 6, 2008 at 2:17 PM, Andrew Welch 
<andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> wrote:
On 06/03/2008, igutierrez027(_at_)ikasle(_dot_)ehu(_dot_)es 
<igutierrez027(_at_)ikasle(_dot_)ehu(_dot_)es> wrote:
 > Hello everybody!
 >
 >  How I can do for put <xs:schema ....> in his next new-line and also
 >  <xs:element name="newFile" type="xs:string"/> in his next new-line?
 >
 >
 >  <?xml version="1.0" encoding="UTF-8><xs:schema
 >  xmlns:xs="http://www.w3.org/2001/XMLSchema";
 >  xmlns:dc="http://purl.org/dc/elements/1.1/";
 >  xmlns:ns1="http://bibtexml.sf.net/"; elementFormDefault="qualified"
 >  targetNamespace="http://bibtexml.sf.net/"; version="2.0">
 >
 >   <xs:import namespace="http://purl.org/dc/elements/1.1/";
 >  schemaLocation="dc.xsd"/>
 >   <xs:element name="dateofread" type="xs:date"/>
 >   <xs:element name="reviewed" type="xs:string"/><xs:element
 >  name="newFile" type="xs:string"/>
 >
 >  </xs:schema>

 I think you are after:

 <xsl:output indent="yes"/>

 used with at least:

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

 By the way your XML declaration is:


 <?xml version="1.0" encoding="UTF-8>

 when it should end with:

 ....encoding="UTF-8"?>

 you get some funny error message without that quote and question mark  :)


 --
 Andrew Welch
 http://andrewjwelch.com
 Kernow: http://kernowforsaxon.sf.net/



 --~------------------------------------------------------------------
 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
 To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
 or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
 --~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>