How to un - to-XML

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to un - to-XML

Hank Ratzesberger

I have content with escaped characters and I want to
covert it back to back to xml.  The document looks like
this:  

 <document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xsi:type="xs:string"
           content-type="text/plain">&lt;shaker type="pfarr"&gt; ......

it may not be clear that the content is xml.  The execute processor
is creating the document and I don't see a way to tell
it to leave it as xml and not run it through the
XML converter (trying <?xml ...?> instruction now).

If all of you are also ready to call it week, then
have a nice weekend!

--Hank

Hank Ratzesberger
NEES Programmer
Institute for Crustal Studies
University of California, Santa Barbara
805.893.8042
805.893.8649 (fax)




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: How to un - to-XML

Alessandro  Vernet
Administrator
Hi Hank,

One way to do this is to use the saxon:parse() function from XSLT:

http://www.saxonica.com/documentation/extensions/functions/parse.html

Alex

On 5/26/06, Hank Ratzesberger <[hidden email]> wrote:

>
> I have content with escaped characters and I want to
> covert it back to back to xml.  The document looks like
> this:
>
>  <document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>            xmlns:xs="http://www.w3.org/2001/XMLSchema"
>            xsi:type="xs:string"
>            content-type="text/plain">&lt;shaker type="pfarr"&gt; ......
>
> it may not be clear that the content is xml.  The execute processor
> is creating the document and I don't see a way to tell
> it to leave it as xml and not run it through the
> XML converter (trying <?xml ...?> instruction now).
>
> If all of you are also ready to call it week, then
> have a nice weekend!
>
> --Hank
>
> Hank Ratzesberger
> NEES Programmer
> Institute for Crustal Studies
> University of California, Santa Barbara
> 805.893.8042
> 805.893.8649 (fax)
>
>
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: How to un - to-XML

Hank Ratzesberger

Alessandro,

Thank you, that would seem to be it, but instead
I get the content, not the XML.  If you put the
following in the XSLT sandbox, you will see what
I mean., but what I want is

<shaker type="pfarr>
  <APChost type="pfstring">192.168.2.14</APChost>
....

I'm sure this is simply an XML issue, but I don't
know what to try next.

Regards,
Hank


Input:

 <document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xsi:type="xs:string"
           content-type="text/plain">&lt;shaker type="pfarr"&gt;
&lt;APChost type="pfstring"&gt;192.168.2.13&lt;/APChost&gt;
&lt;APClogfile type="pfstring"&gt;APClog.txt&lt;/APClogfile&gt;
&lt;APCport type="pfstring"&gt;23&lt;/APCport&gt;

&lt;FGhost type="pfstring"&gt;192.168.2.14&lt;/FGhost&gt;
&lt;FGport type="pfstring"&gt;5025&lt;/FGport&gt;
&lt;Sin_Info type="pftbl"&gt;
&lt;pftbl_entry type="pfstring"&gt;12.0  2&lt;/pftbl_entry&gt;
&lt;/Sin_Info&gt;
&lt;Sweep_Info type="pftbl"&gt;

&lt;pftbl_entry type="pfstring"&gt;12.0  7.0   60&lt;/pftbl_entry&gt;
&lt;pftbl_entry type="pfstring"&gt;11.0  8.0   45&lt;/pftbl_entry&gt;
&lt;/Sweep_Info&gt;
&lt;pf_revision_time type="pfstring"&gt;1136417164&lt;/pf_revision_time&gt;
&lt;/shaker&gt;</document>


XSLT:

<xsl:stylesheet version="2.0" xmlns:saxon="http://saxon.sf.net/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <newroot>
      <xsl:value-of select="saxon:parse(/.)"/>
    </newroot>
  </xsl:template>
</xsl:stylesheet>



----- Original Message -----
From: "Alessandro Vernet" <[hidden email]>
To: <[hidden email]>
Sent: Monday, May 29, 2006 12:26 AM
Subject: Re: [ops-users] How to un - to-XML


Hi Hank,

One way to do this is to use the saxon:parse() function from XSLT:

http://www.saxonica.com/documentation/extensions/functions/parse.html

Alex

On 5/26/06, Hank Ratzesberger <[hidden email]> wrote:

>
> I have content with escaped characters and I want to
> covert it back to back to xml.  The document looks like
> this:
>
>  <document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>            xmlns:xs="http://www.w3.org/2001/XMLSchema"
>            xsi:type="xs:string"
>            content-type="text/plain">&lt;shaker type="pfarr"&gt; ......
>
> it may not be clear that the content is xml.  The execute processor
> is creating the document and I don't see a way to tell
> it to leave it as xml and not run it through the
> XML converter (trying <?xml ...?> instruction now).
>
> If all of you are also ready to call it week, then
> have a nice weekend!
>
> --Hank
>
> Hank Ratzesberger
> NEES Programmer
> Institute for Crustal Studies
> University of California, Santa Barbara
> 805.893.8042
> 805.893.8649 (fax)
>



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: How to un - to-XML

Hank Ratzesberger
OK to get the content as xml:

<xsl:copy-of select="saxon:parse(string(/.))"/>

Failed another XSLT quiz!

Thanks,
Hank


----- Original Message -----
From: "Hank Ratzesberger" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, May 30, 2006 10:49 AM
Subject: Re: [ops-users] How to un - to-XML


>
> Alessandro,
>
> Thank you, that would seem to be it, but instead
> I get the content, not the XML.  If you put the
> following in the XSLT sandbox, you will see what
> I mean., but what I want is
>
> <shaker type="pfarr>
>  <APChost type="pfstring">192.168.2.14</APChost>
> ....
>
> I'm sure this is simply an XML issue, but I don't
> know what to try next.
>
> Regards,
> Hank
>
>
> Input:
>
> <document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>           xmlns:xs="http://www.w3.org/2001/XMLSchema"
>           xsi:type="xs:string"
>           content-type="text/plain">&lt;shaker type="pfarr"&gt;
> &lt;APChost type="pfstring"&gt;192.168.2.13&lt;/APChost&gt;
> &lt;APClogfile type="pfstring"&gt;APClog.txt&lt;/APClogfile&gt;
> &lt;APCport type="pfstring"&gt;23&lt;/APCport&gt;
>
> &lt;FGhost type="pfstring"&gt;192.168.2.14&lt;/FGhost&gt;
> &lt;FGport type="pfstring"&gt;5025&lt;/FGport&gt;
> &lt;Sin_Info type="pftbl"&gt;
> &lt;pftbl_entry type="pfstring"&gt;12.0  2&lt;/pftbl_entry&gt;
> &lt;/Sin_Info&gt;
> &lt;Sweep_Info type="pftbl"&gt;
>
> &lt;pftbl_entry type="pfstring"&gt;12.0  7.0   60&lt;/pftbl_entry&gt;
> &lt;pftbl_entry type="pfstring"&gt;11.0  8.0   45&lt;/pftbl_entry&gt;
> &lt;/Sweep_Info&gt;
> &lt;pf_revision_time type="pfstring"&gt;1136417164&lt;/pf_revision_time&gt;
> &lt;/shaker&gt;</document>
>
>
> XSLT:
>
> <xsl:stylesheet version="2.0" xmlns:saxon="http://saxon.sf.net/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>  <xsl:template match="/">
>    <newroot>
>      <xsl:value-of select="saxon:parse(/.)"/>
>    </newroot>
>  </xsl:template>
> </xsl:stylesheet>
>
>
>
> ----- Original Message -----
> From: "Alessandro Vernet" <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, May 29, 2006 12:26 AM
> Subject: Re: [ops-users] How to un - to-XML
>
>
> Hi Hank,
>
> One way to do this is to use the saxon:parse() function from XSLT:
>
> http://www.saxonica.com/documentation/extensions/functions/parse.html
>
> Alex
>
> On 5/26/06, Hank Ratzesberger <[hidden email]> wrote:
>>
>> I have content with escaped characters and I want to
>> covert it back to back to xml.  The document looks like
>> this:
>>
>>  <document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>            xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>            xsi:type="xs:string"
>>            content-type="text/plain">&lt;shaker type="pfarr"&gt; ......
>>
>> it may not be clear that the content is xml.  The execute processor
>> is creating the document and I don't see a way to tell
>> it to leave it as xml and not run it through the
>> XML converter (trying <?xml ...?> instruction now).
>>
>> If all of you are also ready to call it week, then
>> have a nice weekend!
>>
>> --Hank
>>
>> Hank Ratzesberger
>> NEES Programmer
>> Institute for Crustal Studies
>> University of California, Santa Barbara
>> 805.893.8042
>> 805.893.8649 (fax)
>>
>
>
>

--------------------------------------------------------------------------------


>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws