Actions
Support #3186
closedSaxon API: How to extract output from XdmDestination
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>
<connections>
<conn-name>qa-gdc1</conn-name>
</connections>
</svs>
</show>
</nf:data>
</nf:rpc-reply>
Files
Please register to edit this issue
Actions