I have an issue which perhaps is intentional, but can find no documentation directly addressing my expectations.
The short of it is I expect the parser used within notesXSLTransformer class (xalan-c) to honor my called XSLT reference to an external http url for some XML data I need during the transformation of domino data into “compliant” data based on my vendor requirements.
Setting it up…
There is way too much information to my actual file, so I will do a gross simplification for the sake of this post. Forgive me as I am capturing only the most critical pieces so the picture can make a little sense. I haven’t pasted it into my xml ide, so layout syntax and function straight away would be a crap shoot.
MY DAILY FILE : My daily file being transformed into dtd compliant xml -
…
<items>
<item>
<ItemID>1a2b</ItemID>
<description>Something Green</description>
<cost>1.00</cost>
</item>
<item>
<ItemID>1b2c</ItemID>
<description>Something Blue</description>
<cost>1.00</cost>
</item>
<item>
<ItemID>1b2b</ItemID>
<description>Something Yellow</description>
<cost>1.00</cost>
</item>
<item>
<ItemID>1c2b</ItemID>
<description>Something Black</description>
<cost>1.00</cost>
</item>
</items>
…
ACTIVE CONTENT FILE : The inventory file I can get via url from my vendor
lists only the uniqueIDs i have active in their system:
i want to retrieve it during transformation at http://www.mysamplevendor.com/getYourActiveProducts.aspx?yid=12345
1b2c
1b2b
1c2b
1b2e
MY STYLESHEET:
<?xml version="1.0" encoding="UTF-8" ?><xsl:stylesheet version=“1.0” xmlns:xsl=“XSLT Namespace”>
<xsl:output method=“xml” indent=“yes” />
<xsl:strip-space elements=“*” />
<xsl:variable name=“ac-file” select=“document(‘http://www.mysamplevendor.com/getYourActiveProducts.aspx?yid=12345’)” />
<xsl:variable name=“daily-li” select=“listing/items/item/itemID”/>
<xsl:template match=“doc/uniqueItemID”>
<xsl:when test=“self::node()[not(self::uniqueItemID=$daily-li)]”>
xsl:textDELETE</xsl:text>
<xsl:copy-of select=“self::node()[not(self::node()=$daily-li)]” />
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match=“/”>
<headerCode><xsl:value-of select="EXTERNALID"/></headerCode>
<companyName><xsl:value-of select="EXTERNALNAME"/></companyName>
<dateRun><xsl:value-of select="RUNDATE"/></dateRun>
<xsl:for-each select=“listing/items”>
<transactionType><xsl:text>UPDATE</xsl:text></transactionType>
<uniqueItemID><xsl:value-of select="ItemID"/></uniqueItemID>
<title><xsl:value-of select="description"/></title>
<lowestPrice><xsl:value-of select="cost"/></lowestPrice>
</xsl:for-each>
<xsl:for-each select=“$ac-file”>
<xsl:apply-templates select="self::uniqueItemID"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
MY OUTPUT TO THE VENDOR : The final result should be something like:
<header>
<headerCode>XXXXX</headerCode>
<companyName>My Company</companyName>
<otherStuff>and on and on</otherStuff>
<products>
<unit>
<transactionType>Add</transactionType>
<uniqueItemID>1a2b</uniqueItemID>
<title>Something Green</title>
<lowestPrice>1.00</lowestPrice>
</unit>
<unit>
<transactionType>Update</transactionType>
<uniqueItemID>1b2c</uniqueItemID>
<title>Something Blue</title>
<lowestPrice>1.00</lowestPrice>
</unit>
<unit>
<transactionType>Update</transactionType>
<uniqueItemID>1b2b</uniqueItemID>
<title>SomethingYellow</title>
<lowestPrice>1.00</lowestPrice>
</unit>
<unit>
<transactionType>Update</transactionType>
<uniqueItemID>1c2b</uniqueItemID>
<title>Something Black</title>
<lowestPrice>1.00</lowestPrice>
</unit>
<unit>
<transactionType>Delete</transactionType>
<uniqueItemID>1b2e</uniqueItemID>
<title>Something Red and Purple</title>
<lowestPrice>1.00</lowestPrice>
</unit>
</products>
Out of all this the important part is that the xalan parser coughs up a lung when I use any url. Has IBM throttled the parser down to local system access only? If so is there a workaround. I sure don’t want to download the xml and save into a file every day before the transformation will work.
thanks in advance for any insights.