Page 1 of 1

Referencing inside of an xi:included xml file from debugger

Posted: Thu Jan 05, 2006 10:58 pm
by ggorman
When I use <xi:include/> to pick up xml from another file, the debugger doesn't show the source of data. That is, when I click a line in the Output pane, it highlights the xsl line that created that data and it highlights the <xi:include/> statement that points to the xml file that contains the data element referenced for that output.

I use this syntax for instance in my input xml file
<?xml version="1.0" encoding="UTF-8"?>
<top xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="some_clocks_tb.xml" />
<xi:include href="tempRgmVerilogStage1.xml" />
<xi:include href="tempClkArcSynSYNTHESIS.xml" />
</top>

Can we get the debugger to show the line in included file that contains the element referenced? In the meantime, to debug, I copy/paste the included file over the <xi:include/> statement.

GeorgeG

Posted: Fri Jan 06, 2006 12:13 pm
by sorin_ristache
Hello,

That is not possible. Both the Saxon and Xalan transformers report the location inside the main XML input source for all the XML input elements and they are right. They cannot report a location inside an included file because such a location is not always accurate. The process of resolving the XInclude reference enhances the content of the included file so the processed elements are not exactly the same as the included ones. For example resolving the XInclude reference adds the xml:base attribute. If you output the value of the xml:base attribute and click on it in the output view what should be the location in the source XML input which generated that part of the output ?

Create the complete document by applying the following stylesheet on your document

Code: Select all

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:copy-of select="/"/>
</xsl:template>
</xsl:stylesheet>
and debug your stylesheet on the complete document.

Regards,
Sorin

Posted: Fri Jan 06, 2006 5:43 pm
by ggorman
Hi Sorin,

Good explaination. And thanks for the solution. I thought of something like that to replace my copy/paste; but didn't imagine just 5 lines of xsl -- thanks!

GeorgeG