This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Large Text to Output without escape characters


Hi to everyone,

Firstly, thnx to all of those who answered my
previous question.

Now, I have another problem and I think I know
the solution but I don't know how to implement it.

I want to output a large text, specifically an
e-mail body, in an XML file like this:

<mail>
   <from>From</from>
   <to>To</to>
   <subject>subject</subject>
   <textBody>

     Here goes a Java instruction to output
     the e-mail body. So here goes the body
     of the message as it is, with any
     character, included those who are
     reserved to XML (&,@,etc).

   </textBody>
</mail>

So, I have read so many mail threads about
the & substitution to &amp;, and I think
that's clear. 

But, what happens when you've got an xml
file with a large text without escape
characters?!? Which is the best solution
to output that text?

I thought to put a CDATA on the textBody like this

     <textBody>
        <![CDATA[  ]]>
     </textBody>

and then when the xsl:template that matches
textBody do a

 <xsl:text><xsl:value of select='.'></xsl:text>

If I output the value between xsl:text then I should
have the output text escaped.

The problem is that the xsl:value of does'nt work,
what Xpath expression do i need?

Thank you in advance,
sorry about the length of the topic.

-----------------------------------
Carles Fragoso i Mariscal
Supercomputing Center of Catalonia
Communications & Operations Dept.
<cfragoso@cesca.es> +34932056464

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]