Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOMSource creation

Status
Not open for further replies.

ben99

Programmer
Feb 10, 2003
2
GB
I am trying to create a DOMSource from a Node pulled from an XML Document. I have a reports.xml file in the following format:

<reports>
<report name = &quot;report1&quot;>
<!--report definition here-->
</report>
<report name = &quot;report2&quot;>
<!--report definition here-->
</report>
</reports>


And am using the DOM to pick out the report Node I want. I then try to create a DOMSource using this report Node, so that i can perform an XSLT transformation using Xalan to present the report.

The problem I get is that the transformation seems to transform _all_ the report Nodes, not just the one I have selected and passed into the DOMSource constructor.

So what I need to know is how do I create a DOMSource using only the selected report Node?

Cheers , Ben
 
Not sure what yur problem is. It is possible that the DOMSource being still attached to the entire DOM tree provides access to the entire document. Therefore the result you see is determined by the XSL(T) you are transforming with.

You could try changing your algorithm to alter the XSL(T) document rather than pick out a Node from your XML source. That way the XSL(T) would now transform the specific Node from the source that you desire.

Good luck
-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top