XSLT Warning in XML transformer stage
Moderators: chulett, rschirm, roy
XSLT Warning in XML transformer stage
Hi ,
I am getting the following warnings in the XML stage,
FeedScript,0: XSLT Warning: The element xsl:sequence is an unknown XSLT element. (, line 9, column 254.)
FeedScript,0: Error: The function 'if' was not found.
expression = 'if ( $SV_BaseOutputFileName ) then $SV_BaseOutputFileName else 'FEED_SCRIPT'' Remaining tokens are: ('if' '(' '$' 'SV_BaseOutputFileName' ')' 'then' '$' 'SV_BaseOutputFileName' 'else' ''FEED_SCRIPT'')
I simplified the original job so that it is as below :
A Flat file input ( one column of string) and an XML stage and then Flat File output ( one column of string).
There is an XSLT transformation in the XML stage
here is my XML input
<?xml version="1.0" encoding="UTF-8" ?><NOTIFICATION><Parameter><BatchID>1451</BatchID><StartDateTime>2010-11-10 11:25</StartDateTime><EndDateTime>2010-11-10 11:42</EndDateTime><ManualDataFile>1</ManualDataFile><UseValidationFailedFile>0</UseValidationFailedFile><FillInMissingObservations>0</FillInMissingObservations><FillInMissingObservationsWithValue>0</FillInMissingObservationsWithValue><ReportOnMissingValues>0</ReportOnMissingValues><PerformPlausibilityCheck>1</PerformPlausibilityCheck><PerformZeroCheck>0</PerformZeroCheck><RejectIfFailedZeroCheck>0</RejectIfFailedZeroCheck><AlwaysOverrideHistory>0</AlwaysOverrideHistory><AlwaysCreateVintage>0</AlwaysCreateVintage><PerformHistoricalUpdatesCheck>1</PerformHistoricalUpdatesCheck><AllowHistoricalUpdates>1</AllowHistoricalUpdates></Parameter><File><FileNotFound>DataFeedPrefix</FileNotFound></File></NOTIFICATION>
here is the first 10 lines of the XSLT tranformation text.
<!--Designed and generated by Altova StyleVision Enterprise Edition 2011 rel. 2 - see http://www.altova.com/stylevision for more information.-->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:altova="http://www.altova.com" xmlns:altovaext="http://www.altova.com/xslt-extensions" xmlns:clitype="clitype" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:iso4217="http://www.xbrl.org/2003/iso4217" xmlns:ix="http://www.xbrl.org/2008/inlineXBRL" xmlns:java="java" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:sps="http://www.altova.com/StyleVision/user-xpath-functions" xmlns:xbrldi="http://xbrl.org/2006/xbrldi" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output version="4.0" method="html" indent="no" encoding="UTF-8" use-character-maps="spaces" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:character-map name="spaces">
<xsl:output-character character=" " string=" "/>
</xsl:character-map>
<xsl:param name="SV_OutputFormat" select="'HTML'"/>
<xsl:param name="SV_BaseOutputFileName" as="xs:string?">
<xsl:sequence select="for $i in altovaext:get-base-output-uri(), $j in tokenize( $i, '[/\\]' )[last()] return replace( $j, '\.[^\.\s#%;]*$', '' )" use-when="function-available('altovaext:get-base-output-uri')"/>
</xsl:param>
.....
...
I am getting the following warnings in the XML stage,
FeedScript,0: XSLT Warning: The element xsl:sequence is an unknown XSLT element. (, line 9, column 254.)
FeedScript,0: Error: The function 'if' was not found.
expression = 'if ( $SV_BaseOutputFileName ) then $SV_BaseOutputFileName else 'FEED_SCRIPT'' Remaining tokens are: ('if' '(' '$' 'SV_BaseOutputFileName' ')' 'then' '$' 'SV_BaseOutputFileName' 'else' ''FEED_SCRIPT'')
I simplified the original job so that it is as below :
A Flat file input ( one column of string) and an XML stage and then Flat File output ( one column of string).
There is an XSLT transformation in the XML stage
here is my XML input
<?xml version="1.0" encoding="UTF-8" ?><NOTIFICATION><Parameter><BatchID>1451</BatchID><StartDateTime>2010-11-10 11:25</StartDateTime><EndDateTime>2010-11-10 11:42</EndDateTime><ManualDataFile>1</ManualDataFile><UseValidationFailedFile>0</UseValidationFailedFile><FillInMissingObservations>0</FillInMissingObservations><FillInMissingObservationsWithValue>0</FillInMissingObservationsWithValue><ReportOnMissingValues>0</ReportOnMissingValues><PerformPlausibilityCheck>1</PerformPlausibilityCheck><PerformZeroCheck>0</PerformZeroCheck><RejectIfFailedZeroCheck>0</RejectIfFailedZeroCheck><AlwaysOverrideHistory>0</AlwaysOverrideHistory><AlwaysCreateVintage>0</AlwaysCreateVintage><PerformHistoricalUpdatesCheck>1</PerformHistoricalUpdatesCheck><AllowHistoricalUpdates>1</AllowHistoricalUpdates></Parameter><File><FileNotFound>DataFeedPrefix</FileNotFound></File></NOTIFICATION>
here is the first 10 lines of the XSLT tranformation text.
<!--Designed and generated by Altova StyleVision Enterprise Edition 2011 rel. 2 - see http://www.altova.com/stylevision for more information.-->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:altova="http://www.altova.com" xmlns:altovaext="http://www.altova.com/xslt-extensions" xmlns:clitype="clitype" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:iso4217="http://www.xbrl.org/2003/iso4217" xmlns:ix="http://www.xbrl.org/2008/inlineXBRL" xmlns:java="java" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:sps="http://www.altova.com/StyleVision/user-xpath-functions" xmlns:xbrldi="http://xbrl.org/2006/xbrldi" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output version="4.0" method="html" indent="no" encoding="UTF-8" use-character-maps="spaces" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:character-map name="spaces">
<xsl:output-character character=" " string=" "/>
</xsl:character-map>
<xsl:param name="SV_OutputFormat" select="'HTML'"/>
<xsl:param name="SV_BaseOutputFileName" as="xs:string?">
<xsl:sequence select="for $i in altovaext:get-base-output-uri(), $j in tokenize( $i, '[/\\]' )[last()] return replace( $j, '\.[^\.\s#%;]*$', '' )" use-when="function-available('altovaext:get-base-output-uri')"/>
</xsl:param>
.....
...
You may want to consider looking at the new xml Stage in 8.5. It is no longer based on xslt for its processing....providing two possibilities...
a) It left in a "filter" features that allows you to invoke xslt as it ingests the xml. I haven't had a chance to try it, but it is a way to potentially adapt something that in xmlPack2, utilized custom xslt. It's "possible" that this filter supports a higher level of xslt.
b) It can do more. The xml Transformer was often used to do things that were otherwise difficult to do if you needed to shred the nodes and then put them back together (or other complex twisting and turning of elements and attributes). It's possible that you may be able to accomplish your goals with the new Stage.
Ernie
a) It left in a "filter" features that allows you to invoke xslt as it ingests the xml. I haven't had a chance to try it, but it is a way to potentially adapt something that in xmlPack2, utilized custom xslt. It's "possible" that this filter supports a higher level of xslt.
b) It can do more. The xml Transformer was often used to do things that were otherwise difficult to do if you needed to shred the nodes and then put them back together (or other complex twisting and turning of elements and attributes). It's possible that you may be able to accomplish your goals with the new Stage.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Describe also what you are trying to do with your xml transformation..........are you reading xml and putting it into something else (flat file, csv, rdbms)? ...reading xml and putting it into "another" xml? ....reading flat files or rdbms and putting all of those into a target xml? That will help with guidance here and also with the new Stage.
Ernie
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Well. Cool. Very interesting. XML tags into HTML tags. How big is the document? Do you have to re-arrange it too? Do you have to Transform any values before you set them up for display purposes?
If it's fairly one:one ("change this main elemenet to the "body" and always make this element bold", etc.), you might be able to do a zap of element names and such into tags using a regular transformer and forget xml stages altogether....
Otherwise, why not just put in a stylesheet entry in the header and be done with it (where the stylesheet has all the rules for display of various elements and attributes)? Is this html being processed by something other than a browser? ...like a legacy app that only knows about html and hasn't been updated to support stylesheets?
...just curious.
Ernie
If it's fairly one:one ("change this main elemenet to the "body" and always make this element bold", etc.), you might be able to do a zap of element names and such into tags using a regular transformer and forget xml stages altogether....
Otherwise, why not just put in a stylesheet entry in the header and be done with it (where the stylesheet has all the rules for display of various elements and attributes)? Is this html being processed by something other than a browser? ...like a legacy app that only knows about html and hasn't been updated to support stylesheets?
...just curious.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Hi Ernie,
The XML input to the XML transformer is not fixed or constant file, it is produced in the job, to simplify the problem I said that the XML is coming from a flat file to the XML transformer and the output of the transformer is the HTML document.
in the actual job the XML input is produced dynamically in the job and and fed to the XML stages with( there will be 8 of them with different XSLTs in them depending of the value of a job parameter ) and one of the 8 XML stage will be active and produces one HTML document and that will be our body of the email that is going to be sent right after the job finishes.
I did not understand all of your suggestion but Do you think the body of the email can be XML and will be displayed correctly? otherwise how can we dynamically convert the XML to HTML otherwise?
The XML input to the XML transformer is not fixed or constant file, it is produced in the job, to simplify the problem I said that the XML is coming from a flat file to the XML transformer and the output of the transformer is the HTML document.
in the actual job the XML input is produced dynamically in the job and and fed to the XML stages with( there will be 8 of them with different XSLTs in them depending of the value of a job parameter ) and one of the 8 XML stage will be active and produces one HTML document and that will be our body of the email that is going to be sent right after the job finishes.
I did not understand all of your suggestion but Do you think the body of the email can be XML and will be displayed correctly? otherwise how can we dynamically convert the XML to HTML otherwise?
I am not a stylesheet expert, but I've seen people write some pretty sophisticated ones. It sounds like you have some dynamically created structures, but in the end, there are "8" varieties?
Again, I have no idea about the email tooling you are trying to support, and am not an expert on stylesheets but I would certainly wonder (and investigate) whether the email tooling receiving this is able to support html rendering including support for stylesheets. That way you would simply have "n" stylesheets (or maybe even one big one that recognizes and looks for the "n" xml varieties and their elements), sent along with the xml, and the email would use them to process and display the xml, just like a browser does.
As noted --- I'm not an expert, but have used some very simple stylesheets with our own ISD technology. By analogy, ISD generates an xml response [using the 8.x REST binding] and sends it down the wire --- along with a stylesheet that is defined for "that" xml content. Somehow (this is where we'd need to speak with a stylesheet expert) the browser knows to utilize the spreadsheet to perform the display. The page looks attractive (I usually use it with a simple stylesheet to create attractive columns for returned data from DataStage), but if you look at the "page source", it's raw xml.
So... who knows...but it would be worth investigating with whoever manages your email clients. Then you could craft one stylesheet, ever, and just sent your xml with a pointer to that stylesheet.... ?
Ernie
Again, I have no idea about the email tooling you are trying to support, and am not an expert on stylesheets but I would certainly wonder (and investigate) whether the email tooling receiving this is able to support html rendering including support for stylesheets. That way you would simply have "n" stylesheets (or maybe even one big one that recognizes and looks for the "n" xml varieties and their elements), sent along with the xml, and the email would use them to process and display the xml, just like a browser does.
As noted --- I'm not an expert, but have used some very simple stylesheets with our own ISD technology. By analogy, ISD generates an xml response [using the 8.x REST binding] and sends it down the wire --- along with a stylesheet that is defined for "that" xml content. Somehow (this is where we'd need to speak with a stylesheet expert) the browser knows to utilize the spreadsheet to perform the display. The page looks attractive (I usually use it with a simple stylesheet to create attractive columns for returned data from DataStage), but if you look at the "page source", it's raw xml.
So... who knows...but it would be worth investigating with whoever manages your email clients. Then you could craft one stylesheet, ever, and just sent your xml with a pointer to that stylesheet.... ?
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Hi Ernie,
the tool we use to send the email is the sendmail utility in linux. at the receiving end, the users who will read these emails are using MS outlook.
I am not sure( don't really think) if Outlook can show the XML content even if we send the stylesheet with it.
Do you think it is still possible?, are they any security concern regarding your suggested solution, as the environment is very strict.
Thanks again
the tool we use to send the email is the sendmail utility in linux. at the receiving end, the users who will read these emails are using MS outlook.
I am not sure( don't really think) if Outlook can show the XML content even if we send the stylesheet with it.
Do you think it is still possible?, are they any security concern regarding your suggested solution, as the environment is very strict.
Thanks again
Thanks,
Chad
__________________________________________________________________
"There are three kinds of people in this world; Ones who know how to count and the others who don't know how to count !"
Chad
__________________________________________________________________
"There are three kinds of people in this world; Ones who know how to count and the others who don't know how to count !"
Only an Outlook administrator expert will know. Perhaps they have forums like this one.
Ernie
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
Are you using the old XML Pack or the new XML Assembly? I would expect the new XML Assembly for version 8.5 to be more up to date on stylesheet validation than the old XML Pack. XML Pack is a few years old now.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn