Project

Profile

Help

Support #3186

closed

Saxon API: How to extract output from XdmDestination

Added by Sunny boddu over 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2017-03-29
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

Hi,

I am using SaxonAPI .Net version,

I have simple xsl and xml. I am using below code to transform the xml and expecting output.

I have attached xsl and xml files already.

The problem currently I am having is, The output in destination is not proper xml. The output xml contains "<" and ">" in xml instead of proper xml tags '<', '>'.

Can anyone help me what the causing the error?

Below is the code snippet I m using :

            var processor = new Processor();

            XsltCompiler xslComp = processor.NewXsltCompiler();

            XsltExecutable xslExec = xslComp.Compile(xslUri);


            XsltTransformer xslTrans = xslExec.Load();

XdmDestination xdmD = new XdmDestination();

            Serializer serializer = processor.NewSerializer();


            using (FileStream fs = File.Open(xmlPath, FileMode.Open))

            {

                xslTrans.SetInputStream(fs, schemaUri); // set baseUri

                xslTrans.Run(xdmD);

            }


            XdmNode value = null;


            if (xdmD != null)

            {

                value = xdmD.XdmNode;

            }

Current output looks like below:

<?xml version="1.0" encoding="ISO-8859-1"?>

<nf:rpc-reply xmlns:nf="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="http://www.cisco.com/nxos:1.0:vms">

<nf:data>

<show>

<svs>

&lt;connections&gt;

    &lt;conn-name&gt;qa-gdc1&lt;/conn-name&gt;        

&lt;/connections&gt;

</svs>

</show>

</nf:data>

</nf:rpc-reply>


Files

xsl.xsl (475 Bytes) xsl.xsl Input xsl Sunny boddu, 2017-03-29 16:24
xml.xml (362 Bytes) xml.xml Input xml Sunny boddu, 2017-03-29 16:24
output.xml (399 Bytes) output.xml Sunny boddu, 2017-03-29 16:27
output.PNG (45.5 KB) output.PNG Sunny boddu, 2017-03-29 16:31

Please register to edit this issue

Also available in: Atom PDF