BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


XSLT
XTrans 1.0
XML Explorer 2.5
Create an N-Column Table from XML node-set
XSLT Select Option Example
XSLT Date filtering, sorting, comparing, and evaluating
XSLT Template for HTML INPUT Tag
XSLT Template for HTML IMG Tag
XSLT Search and Replace Template
Word wrap and text replace templates for XSLT
nxslt 1.3
Visual XPath
xframe - xsddoc
-xsl-fo-->-pdf--making-an-e-book/documentation.aspx>BIBLE PDF from (xml & xsl)-> xsl-fo -> pdf ; Making an E-book/documentation
Sum(round(.))
DISTINCT list of attributes using XPATH only
How to add a XSL information to the XML file with the XmlTextWriter?
How to update an XML file with XmlDocument?
How to select specific nodes in XmlDocument()?
How to use GetElementsByTagName in XmlDocument?
How to Import a Node with XmlDocument and ImportNode?


 
 

<< XQuery.NET and XML >>


By John Workman
First Posted 06/21/2003
Times viewed 1047

Cross Reference Lookup in XSLT using embedded XML


Summary This snippet shows you how to embed xml into your transform and use it as a xref table.

Have you every needed to use a cross reference table when transforming an xml document? This snippet shows you how. This is very similar to another sample I've submitted, except that this example has the xml file embedded in the transform instead of using an external file. The reason I am submitting is is because there is a "gotcha" that you don't see documented anywhere. You have to make sure that you assign a namespace to the xml lookup table. You then you the document('') function with two single quotes. It loads the xref table into a variable. Then it loops through the source document re-writing the xml file while replacing the payrollID with the employeeID. One thing to be careful of is make sure that you load the document into a variable outside of the loop and then search the variable instead of re-loading the file each time.

Additional information

Further additional information


Rate this article on a scale of 1 to 10 (0 votes, average 0)

Your vote :  

<< XQuery.NET and XML >>





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML