XSLT Warning in XML transformer stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

XSLT Warning in XML transformer stage

Post by mctny »

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="&nbsp;"/>
</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, &apos;[/\\]&apos; )[last()] return replace( $j, &apos;\.[^\.\s#%;]*$&apos;, &apos;&apos; )" use-when="function-available(&apos;altovaext:get-base-output-uri&apos;)"/>
</xsl:param>

.....
...
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

Reading the error message, it looks like even DS 8.5 does not support XSLT 2.0 yet.
mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

Post by mctny »

My colleague said that he tried with XSLT 1.0 and it gave the same errors.
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 !"
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

I don't think there is an xsl:sequence element for XSLT Version 1.0.
mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

Post by mctny »

not sure about the differences in xslt version 1 and 2. But You are probably right.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

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
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

Post by mctny »

Hi Ernie,

Yes that's what we are going to do, install the new XML stage, the same thing also recommended by our support provider,

let's see what will happen

thanks
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

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 Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

Post by mctny »

Hi Ernie,

I am trying to read XML and convert it to HTML by using the XSLT tranformations that I will use in the XML stage.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

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
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

Post by mctny »

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?
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

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
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

Post by mctny »

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
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 !"
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Only an Outlook administrator expert will know. Perhaps they have forums like this one.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

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.
Post Reply