XSLT Trouble
I am using XSLT for the first time. I have a relatively easy XML structure based on data coming from the database, I want to transform it into HTML.
I am using the latest XALAN in the Websphere Test Environment 4.0.
XML:
<?xml version="1.0" encoding="UTF-8"?>
<DATATREE>
<ROW>
<FIELD NAME="ID" DATATYPE="java.lang.Integer">1</FIELD>
<FIELD NAME="PRODUCER_ID" DATATYPE="java.lang.Integer">5556</FIELD>
</ROW>
<ROW>
<FIELD NAME="ID" DATATYPE="java.lang.Integer">2</FIELD>
<FIELD NAME="PRODUCER_ID" DATATYPE="java.lang.Integer">5556</FIELD>
</ROW>
</DATATREE>
The Style Sheet:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" />
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="/DATATREE">
<table>
<xsl:apply-templates />
</table>
</xsl:template>
<xsl:template match="/DATATREE/ROW">
<tr>
<xsl:apply-templates />
</tr>
</xsl:template>
<xsl:template match="/DATATREE/ROW/FIELD">
<td>
<xsl:apply-templates select="text()" />
</td>
</xsl:template>
</xsl:stylesheet>
The code to run this:
public class Stylizer
public void transform(Document datafile, OutputStream out)
File stylesheet = new File("c:\\program files\\ibm\\Application Developer Trial Edition\\workspace\\pspt\\webApplication\\TestStyle.xsl");
TransformerFactory tFactory =
TransformerFactory.newInstance();
StreamSource stylesource = new StreamSource(stylesheet);
Transformer transformer = tFactory.newTransformer(stylesource);
DOMSource source = new DOMSource(document);
System.out.println(source);
StreamResult result = new StreamResult(out);
if (source ==null || result ==null)
transformer.transform(source, result);
//catch exceptions etc
This dies everytime with the following error:
java.lang.IllegalArgumentException: The input node can not be null for a DOMSource for newTemplates!
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:485)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1118)
at com.medica.micro.pspt.dao.source.Stylizer.transform(Stylizer.java:61)
I know I have made some really stupid error here, but all my efforts to rewrite the style sheet have never changed the error at all.
Thanks
Of course I figured out my very stupid error right after I posted this. Thanks anyways!
Similar Messages
-
XSLT : Trouble Adding Namespace
I need to add namespace xmlns:prx="urn:sap.com:proxy:SB1:/1SAI/TAS04BED82951A661E02EC4:701:2008/06/06" to my xml document after doing a PI message mapping.
When I run the following XSLT code in my XML editing software, it works as desired. When I import the XSL program and use it at runtime, it is not adding the namespace. Can anyone help?
XSLT:
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:prx="urn:sap.com:proxy:SB1:/1SAI/TAS04BED82951A661E02EC4:701:2008/06/06">
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/*">
<xsl:copy>
<xsl:copy-of select="document('')/xsl:stylesheet/namespace::*[not(local-name() = 'xsl')]"/>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Source:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:ChartOfAccountsReplicationConfimation xmlns:ns0="http://sap.com/xi/SAPGlobal20/Global">
<MessageHeader>
<UUID>4C321305CA1400AAE10080000A98800D</UUID>
<ReferenceUUID>4bff533d-2452-00f2-e100-80000a98800c</ReferenceUUID>
<CreationDateTime>2010-07-06T13:57:30Z</CreationDateTime>
<SenderBusinessSystemID>ERP_GTPSRM_ECC6_S1</SenderBusinessSystemID>
<RecipientBusinessSystemID>EDG_030_BusinessSystem</RecipientBusinessSystemID>
</MessageHeader>
<Log>
<BusinessDocumentProcessingResultCode>3</BusinessDocumentProcessingResultCode>
<MaximumLogItemSeverityCode>1</MaximumLogItemSeverityCode>
<Item>
<Note>Processed by PI</Note>
</Item>
</Log>
</ns0:ChartOfAccountsReplicationConfimation>
Desired Target:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:ChartOfAccountsReplicationConfimation xmlns:ns0="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="urn:sap.com:proxy:SB1:/1SAI/TAS04BED82951A661E02EC4:701:2008/06/06">
<MessageHeader>
<UUID>4C321305CA1400AAE10080000A98800D</UUID>
<ReferenceUUID>4bff533d-2452-00f2-e100-80000a98800c</ReferenceUUID>
<CreationDateTime>2010-07-06T13:57:30Z</CreationDateTime>
<SenderBusinessSystemID>ERP_GTPSRM_ECC6_S1</SenderBusinessSystemID>
<RecipientBusinessSystemID>EDG_030_BusinessSystem</RecipientBusinessSystemID>
</MessageHeader>
<Log>
<BusinessDocumentProcessingResultCode>3</BusinessDocumentProcessingResultCode>
<MaximumLogItemSeverityCode>1</MaximumLogItemSeverityCode>
<Item>
<Note>Processed by PI</Note>
</Item>
</Log>
</ns0:ChartOfAccountsReplicationConfimation>HI Stefen,
I had one XSL question,i have seen in the blogs you have given correct answers regarding the XSLT.
My requirement is the source file is :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
<ns0:Esri_Identify
xmlns:ns0="http://ottawa.ca/ecc/esri/ecctoesri">
<Identify>
<MapDescription>
<Name/>
<Rotation/>
</MapDescription>
<MapImageDisplay>
<ImageHeight/>
<ImageWidth/>
<ImageDPI/>
</MapImageDisplay>
<SearchShape>
<X/>
<Y/>
</SearchShape>
<Tolerance/>
<IdentifyOption/>
<LayerIDs>
<Int/>
</LayerIDs>
</Identify>
</ns0:Esri_Identify>
and expected is :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
<ns0:Esri_Identify
xmlns:ns0="http://ottawa.ca/ecc/esri/ecctoesri">
<Identify>
<MapDescription>
<Name/>
<Rotation/>
</MapDescription>
<MapImageDisplay>
<ImageHeight/>
<ImageWidth/>
<ImageDPI/>
</MapImageDisplay>
<SearchShape xmlns:q4="http://www.esri.com/schemas/ArcGIS/10.0" xsi:type="q4:PointN" xmlns="">
<X/>
<Y/>
</SearchShape>
<Tolerance/>
<IdentifyOption/>
<LayerIDs>
<Int/>
</LayerIDs>
</Identify>
</ns0:Esri_Identify>
I need to pass the name space for searchshape element, can you please help me in this regard.
Thanks, -
XSLT Mapping: Namespace for prefix 'ns0' has not been declared
Hello, I am working on a synchronous SOAP call and having some trouble with the response message. The web service has its own namespace and I am trying to convert this to my custom data type in PI. PI wants the message to be in format of having ns0 prefix and namespace like we have defined (http://foo for example).
I have an XSLT mapping (see below) which works fine with my test response payload (pulled from SXMB_MONI source) on this online XSLT test site:
http://www.freeformatter.com/xsl-transformer.html
However when I import this archive to PI and test with operation mapping it always says "Namespace for prefix 'ns0' has not been declared."
This is very confusing because when I test it online, I see both prefix and namespace declaration perfectly. Is there a way to see the results in the PI test tool? After this XSLT java error it doesn't give me the output even in Trace Level All mode.
Please advise on this issue or if you know an easier way (such as altering my datatype/message type to match the inbound SOAP message). I tried working with the 3rd party WSDL but the response message types show a different root level node than what PI is receiving so I gave up to make my own matching datatype. I just have to solve this last inbound namespace issue and should be finished.
FYI I have refreshed all PI caches and activated all objects.
Thanks for your ideas!
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns0="http://foo"
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/*">
<xsl:element name="ns0:{local-name()}">
<xsl:apply-templates select="@* | node()" />
</xsl:element>
</xsl:template>
<xsl:template match="/">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@* | node()" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>Some additional info, here is an example payload which goes through the XSLT mapping perfectly, but in PI I get the error about missing ns0 declaration.
XML input:
<bar xmlns='http://irrelevantnamespace'
xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<foo/>
</bar>
XSLT mapped output using test tool and XSL above:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:bar xmlns:ns0="http://foo">
<foo />
</ns0:bar> -
How to start with XSLT Mapping
Hi Everyone,
How to learn XSLT Mapping,Error Analysis,Triggering alerts and Trouble shooting in XI.Plz could anyone help to get through these areas?I'm facing many problems in my inetrviews in the above mentioned areas.I eagerly waiting for the response.
Regards,
Swapna..Some of the blogs are
/people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
/people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
/people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping
etc -
I need help writing and XSLT to transform an XML in InDesign. I am new to XML and have no idea how to write an XSLT.
We are trying to bring in data from a database using a query language that is having trouble creating the image tags the way we need it to. Basically, I need to take this:
<Project href="file://C:\My test phot.jpg">
and transform it into this:
<Project> <image href="file://C:\My test phot.jpg" />
Can anyone help me with this?
Thanks!Not sure I can help you with this, as my understanding of XSL is very limited.
However, as a matter of trial and error, I find that if I transform this XML:
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<Project href="file://C:\My test phot1.jpg">The first bit of textual content here</Project>
<Project href="file://C:\My test phot2.jpg">The second bit of textual content here</Project>
<Project href="file://C:\My test phot3.jpg">The third bit of textual content here</Project>
<Project href="file://C:\My test phot4.jpg">The fourth bit of textual content here</Project>
<Project href="file://C:\My test phot5.jpg">The fifth bit of textual content here</Project>
</Root>
...with this XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<Root>
<xsl:for-each select="/Root/Project">
<Project>
<image><xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute></image>
<xsl:value-of select="."/>
</Project>
</xsl:for-each>
</Root>
</xsl:template>
</xsl:stylesheet>
...I end up with this XML:
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<Project><image href="file://C:\My test phot1.jpg"/>The first bit of textual content here</Project>
<Project><image href="file://C:\My test phot2.jpg"/>The second bit of textual content here</Project>
<Project><image href="file://C:\My test phot3.jpg"/>The third bit of textual content here</Project>
<Project><image href="file://C:\My test phot4.jpg"/>The fourth bit of textual content here</Project>
<Project><image href="file://C:\My test phot5.jpg"/>The fifth bit of textual content here</Project>
</Root>
...which seems what you're looking for.
[I edited the original solution slightly by removing a wildcard.] -
Why don't standard XPath functions work in XSLT?
I'm having a lot of trouble trying to do some simple string processing in XSLT. What I would like to do is make selection using the standard xpath functions defined by the w3c. I'm using this as my cheat sheet:
http://w3schools.com/xpath/xpath_functions.asp
I've tried the default XSLT parser that comes with Java, the latest distro of Xalan and the latest distro of Saxon. Nothing seems to recognize the fn namespace:
xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
In particular, I'm trying to use the tokenize(string, regex) function. Only Xalan seems to support this at all, only recognizes {http://xml.apache.org/xalan}tokenize, and it is treating the regex as a literal.
This is very frustrating. Is it possible to get the standard Xpath functions to work for XSLT?How did you get it to work with Saxon? I have saxon9he.jar on my classpath. When I try to transform this:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:src="http://xml.kitfox.com/schema/game/tileWorld/textTable"
xmlns:xalan="http://xml.apache.org/xalan"
xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
version="1.0">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:for-each select="fn:tokenize('a b c', '\s+')">
"<xsl:value-of select="."/>"
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>I get the error
Error on line 100
Cannot find a matching 2-argument function named
{http://www.w3.org/2005/02/xpath-functions}tokenize()Is there some other jar you need to include to get http://www.w3.org/2005/02/xpath-functions to resolve? -
XSLT to convert CALS tables into html?
This may be the wrong forum to post this, but I don't know
where else I can, so I would very much appreciate if anyone
can suggest where I can find such information.
I need to write XSLT code that will transform
CALS tables that InDesign exports in XML into HTML.
(I can't simply use the xhtml export feature. I need to
do the transformation from XML to HTML.)
For starters, what would be the XSLT code that I would need to convert
aaaa
bbbb
cccc
dddd
eeee
ffff
into
<table>
<tbody>
<tr>
<td>
<p class="pstyle_cell">aaaa</p></td>
<td>
<p class="pstyle_cell">bbbb</p></td>
</tr>
<tr>
<td>
<p class="pstyle_cell">cccc</p></td>
<td>
<p class="pstyle_cell">dddd</p></td>
</tr>
<tr>
<td>
<p class="pstyle_cell">eeee</p></td>
<td>
<p class="pstyle_cell">ffff</p></td>
</tr>
</tbody>
The thing that I am having the most trouble with
is the extraction of the number of rows and columns from
the xml file and creating the appropriate "for" loop
that will get the <tr></tr> tags in the right places in the HTML.
Thanks in advance.
Tak OsatoNot really. It's never a good idea to consider the actual web page creation as an afterthought to the graphical design. In fact many times it's just simpler to start the web page as such and only add graphical fancy if and when needed selectively. Anyway, there are a few sites that offer PSD to HTML conversion, either automatic or as a paid service, but it will never be perfect. It's the same why a CSS or HTML file created using Save for Web always was and at best always can be a crude start. And in light of all the above, of course PS (or Illustrator or InDesign) are not web design tools, not even for the graphical aspects. Rather spend your time with Muse, Fireworks, Edge, Dreamweaver or one of the gigazillion free tools out there more suitably aimed at web stuff than PS ever could...
Mylenium -
Need to use Xalan in place of Oracle XSLT processor
We are working with Oracle BPEL 10.1.3.3. We have a requirement to use Xalan as the XSLT processor to preserve existing investment into transformation maps built using Contivo (which is certified to work with Xalan).
That said, we are having some trouble getting the Xalan processor to kick in going the java:exec route. For some reason, we end up with Oracle's XSLT processor in spite of asking for the Xalan implementation.
TransformerFactory tFactory = new org.apache.xalan.processor.TransformerFactoryImpl();
Transformer transformer = tFactory.newTransformer(new StreamSource(xslInURI));
System.out.println(tFactory.toString()+transformer.toString());
Strangely enough, the above snippet prints:
[email protected]Transformer@e39f6b
Wondering if anybody else has used Xalan successfully in conjunction with 10.1.3.3 bits. Appreciate your help.please copy and paste the following in your xpath-functions.xml file
<function id="processXSLT" arity="2">
<classname>com.collaxa.cube.xml.xpath.functions.xml.GetElementFromXSLTFunction</classname>
<property id="namespace-uri">
<value>http://schemas.oracle.com/xpath/extension/xalan/xslt</value>
</property>
<property id="namespace-prefix">
<value>xalan</value>
</property>
</function>
This function would try to find the default transformer factory using
TransformerFactory.newInstance()
so you might need to place the xalan transformer factory properties file in the beginning of your classpath (server.xml ) or pass it as jvm system property like below:
-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl -
XSLT question, Parameters from itab
Hi Experts,
I'm using the following code in my abap program:
TYPE-POOLS: abap.
TYPES: BEGIN OF line_type,
vartag TYPE string,
varvalue TYPE string,
END OF line_type.
TYPES: itype TYPE TABLE OF line_type.
DATA: gt_source_itab TYPE abap_trans_srcbind_tab,
gs_source_wa TYPE abap_trans_resbind.
DATA: line TYPE line_type.
DATA: itab TYPE itype.
DATA: output_stream TYPE xstring.
clear line.
line-vartag = 'tagname'.
line-varvalue = 'value'.
APPEND line TO itab.
GET REFERENCE OF itab INTO gs_source_wa-value.
gs_source_wa-name = 'TAG'.
APPEND gs_source_wa TO gt_source_itab.
TRY.
CALL TRANSFORMATION z_cd_xsl
SOURCE (gt_source_itab)
RESULT XML output_stream.
In my Transformation I'm having trouble using the right expression in the select-attribute of xslt-element "xsl:with-param".
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sap="http://www.sap.com/sapxsl"
>
<xsl:include sap:name="Z_INCLUDE_UDKXML"/>
<!-- xsl:strip-space elements="*"/ -->
<xsl:template match="/">
<xsl:call-template name="udk_nachrichtenAnfang">
<xsl:with-param name="NachrAnf_MesBez" select=<Don't know what to do here> />
There are no syntactic errors (rest of the corresponding code is in the include). If i just set the select attribute with plain text, it works. But I want to use the value from my abap variable "varvalue".
I tried select='$LINE-VARVALUE', select="//TAG/VARVALUE", select="VARVALUE" and several others, didn't work.
I'm guessing I'll need some XPATH expression to access the serialized asXML deep structure, but I can't figure it out
Regards, LukasCheck this code.....
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<TAG>
<xsl:apply-templates select="//TAG/item"/>
</TAG>
</xsl:template>
<xsl:template match="TAG/item">
<item>
<VARTAG>
<xsl:value-of select="VARTAG"/>
</VARTAG>
<VARVALUE>
<xsl:value-of select="VARVALUE"/>
</VARVALUE>
</item>
</xsl:template>
</xsl:transform> -
Hi,
I'm doing some XSLT mapping to transform the input XML which is coming to XI from a non-SAP application which do not have any namespace prefix. All I'm doing in the transformation is adding the namespace prefix to the xml so that XI can understand the incoming xml message. my incoming xml is in this format
<?xml version="1.0" standalone="yes" ?>
<response xmlns="http://www.test.com/it">
<request_id>UNKNOWN-TEST-1181313012309</request_id>
<request_type>CREATE_TICKET</request_type>
<result>APPROVED</result>
<service_provider>VERIZON</service_provider>
<extra>
<extra_ReqAck_AckComment>A trouble ticket has already been
created for this circuit</extra_ReqAck_AckComment>
<extra_ReqAck_ackType>Request_Completed</extra_ReqAck_ackType>
<extra_ReqAck_date>2007-06-08</extra_ReqAck_date>
<extra_ReqAck_time>10:29:17</extra_ReqAck_time>
</extra>
<vendor>
<ticket_id>CARC349201</ticket_id>
</vendor>
</response>
And my output xml should be in the following format
<?xml version="1.0" standalone="yes" ?>
<ns1:response xmlns:ns1="http://www.test.com/it">
<request_id>UNKNOWN-TEST-1181313012309</request_id>
<request_type>CREATE_TICKET</request_type>
<result>APPROVED</result>
<service_provider>VERIZON</service_provider>
<vendor>
<ticket_id>CARC349201</ticket_id>
</vendor>
</ns1:response>
Here is my xsl file to
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="*">
<ns1:response xmlns:ns1="http://www.test.com/it">
<request_type>
<xsl:value-of select="request_type"/>
</request_type>
<service_provider>
<xsl:value-of select="service_provider"/>
</service_provider>
<vendor>
<ticket_id>
<xsl:value-of select="ticket_id"/>
</ticket_id>
<ticket_status>
<xsl:value-of select="ticket_status"/>
</ticket_status>
</vendor>
</ns1:response>
</xsl:template>
</xsl:stylesheet>
When I use this stylesheet. I'm getting this response this is not adding the values to the nodes.
<?xml version="1.0" encoding="utf-8"?>
<ns1:response xmlns:ns1="http://www.test.com/it">
<request_type/>
<service_provider/>
<vendor>
<ticket_id/>
<ticket_status/>
</vendor>
</ns1:response>
I would really appreciate if anyone had ever came across this problem or had found solution.
Thanks,
Joe.PHi Udo,
Here is the problem as long as I do have namespace in my input xml that's coming from non sap application the XSLT transformation is failing. I did what you have suggested and here is the style sheet.
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:ns1="http://www.test.com/it/app" >
<xsl:output method="xml" version="2.0" indent="yes"/>
<xsl:template match="/">
<ns1:response>
<request_type>
<xsl:value-of select="//request_type"/>
</request_type>
<result>
<xsl:value-of select="//result" />
</result>
<result_reason>
<xsl:value-of select="//result_reason"/>
</result_reason>
<service_provider>
<xsl:value-of select="//service_provider"/>
</service_provider>
<vendor>
<ticket_id>
<xsl:value-of select="//ticket_id"/>
</ticket_id>
<ticket_status>
<xsl:value-of select="//ticket_status"/>
</ticket_status>
</vendor>
</ns1:response>
</xsl:template>
</xsl:stylesheet>
and as I mention in the initial posting the input xml does have a name space in the response node. so what I tried is I removed the namespace from the input xml from the response node and that works. But I can't remove the namespace from the input xml since that's coming from non sap application.
Thanks,
Joe.P -
Dear Developers,
I am having trouble understanding this XSLT code. Could someone help me to locate ZW_CS/ACCTCLASS and ZW_IC_ADD_ONS/ACCTCLASS. My task is to add another field in the CIC0 screen which is refereing to ZW_CS and ZW_IC_ADD_ONS.
<td><b><xsl:value-of select="sap:otr-text('ZW_CS/ACCTCLASS')"/> </b>
<xsl:variable name="acctclass">ZW_IC_ADD_ONS/ACCTCLASS<xsl:value-of select="attributes/KTOKL"/>
</xsl:variable>
<xsl:value-of select="attributes/KTOKL"/>
</td>
This XSLT program resides in CRM system. There were HTML profile created in R/3 system.
Thanks you and best regards.Dear Developers,
I am having trouble understanding this XSLT code. Could someone help me to locate ZW_CS/ACCTCLASS and ZW_IC_ADD_ONS/ACCTCLASS. My task is to add another field in the CIC0 screen which is refereing to ZW_CS and ZW_IC_ADD_ONS.
<td><xsl:value-of select="sap:otr-text('ZW_CS/ACCTCLASS')"/> <xsl:variable name="acctclass">ZW_IC_ADD_ONS/ACCTCLASS<xsl:value-of select="attributes/KTOKL"/> </xsl:variable> <xsl:value-of select="attributes/KTOKL"/> </td>
This XSLT program resides in CRM system. There were HTML profile created in R/3 system. Thanks you and best regards -
DB, XML, XSLT - I have a problem, HELP
Hi Friends!!
I have a problem and I need your help guys. I was wondering if there is any tool I can use to minimize my Data Base troubles. I work with 3 DataBases (Oracle, DB2, SQLServer) and I have to re-write almost all my SQL code 3 times. I think I could use XML and XSLT and make some magic like the Java magic of "Write once, runs anywhere". Does anyone know what I have to do to solve my problem ??
Thanks a lot my friends
CleversonOracle XML SQL Utility -- XSU converts a xml to a
oracle database.
http://otn.oracle.com/tech/xml/oracle_xsu/content.html
DB2 XML Extender converts xml to a db2 database.
http://www-3.ibm.com/software/data/db2/extenders/xmlext
Another question if I may,
I am looking for a general tool (using JDBC) to extract data from a genral data base (I need inofmrix, oracle, sqlserver, db2 and more) into xml file. I need it to be an effecient also and not create DOM documents. Do you know about a tool like this (maybe an open source?).
Thank you very much,
David -
XSLT position() not returning sequential values
I'm having trouble with the XSLT position() function. I have the following snippet of XML:
<categories>
<category id="6">
<title>Alumni</title>
</category>
<category id="10">
<title>Built Environment</title>
</category>
<category id="9">
<title>Business</title>
</category>
<category id="81">
<title>Caboolture</title>
</category>
<category id="41">
<title>Corporate</title>
</category>
<category id="2">
<title>Creative Industries</title>
</category>
<category id="61">
<title>Cultural Precinct</title>
</category>
<category id="5">
<title>Education</title>
</category>
<category id="7">
<title>Engineering</title>
</category>
<category id="44">
<title>Feature</title>
</category>
<category id="4">
<title>Health</title>
</category>
<category id="43">
<title>Humanities & Human Services</title>
</category>
<category id="42">
<title>Information Technology</title>
</category>
<category id="8">
<title>Law</title>
</category>
<category id="45">
<title>Profile</title>
</category>
<category id="101">
<title>Public</title>
</category>
<category id="21">
<title>QUT Carseldine</title>
</category>
<category id="1">
<title>Science</title>
</category>
<category id="3">
<title>What's On</title>
</category>
</categories>and the following template to match each category element:
<xsl:template match="category">
<tr>
<td width="10" valign="top" background="graphics/mid_bracket.gif"> </td>
<td width="10" valign="top"><img alt="" width="10" height="15" border="0" src="/graphics/blank.gif" name="rollitem0_{position()}"/></td>
<td width="160"><a href="/general/news-event-list.jsp?news-category-id={@id}" class="level3menu" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('rollitem0_{position()}','','graphics/arrow.gif',1)"><xsl:apply-templates/></a></td>
</tr>
</xsl:template>I would expect the position() function to return 1, 2, 3, 4...19 but it doesn't. It is returning 2, 4, 6, 8...36. Does anyone have any idea why this might be happening? Surely the position should return the position of the current element within its siblings. I can only think that it is counting blank text nodes between each category element. Sorry for the complex markup, I wanted to be sure I was giving a real-world example.
Thanks.Stylesheet:
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
<xsl:output method = "text" />
<xsl:template match = "category" >
<xsl:text >
category[</xsl:text>
<xsl:value-of select = "position()" />
<xsl:text >]: </xsl:text>
<xsl:value-of select = "." />
</xsl:template>
</xsl:stylesheet>
produces output:
category[2]: Alumni
category[4]: Built Environment
category[6]: Business
category[8]: Caboolture
category[10]: Corporate
category[12]: Creative Industries
category[14]: Cultural Precinct
category[16]: Education
category[18]: Engineering
category[20]: Feature
category[22]: Health
category[24]: Humanities & Human Services
category[26]: Information Technology
category[28]: Law
category[30]: Profile
category[32]: Public
category[34]: QUT Carseldine
category[36]: Science
category[38]: What's On
stylesheet:
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
<xsl:output method = "text" />
<xsl:template match = "/" >
<xsl:apply-templates select = "//category" />
</xsl:template>
<xsl:template match = "category" >
<xsl:text >
category[</xsl:text>
<xsl:value-of select = "position()" />
<xsl:text >]: </xsl:text>
<xsl:value-of select = "." />
</xsl:template>
</xsl:stylesheet>
produces output:
category[1]: Alumni
category[2]: Built Environment
category[3]: Business
category[4]: Caboolture
category[5]: Corporate
category[6]: Creative Industries
category[7]: Cultural Precinct
category[8]: Education
category[9]: Engineering
category[10]: Feature
category[11]: Health
category[12]: Humanities & Human Services
category[13]: Information Technology
category[14]: Law
category[15]: Profile
category[16]: Public
category[17]: QUT Carseldine
category[18]: Science
category[19]: What's On -
LSO 600 Configuration - Central Storage Location for XSLT Files
Hi,
We are implementing LSO 600 with enhancement pack 2 and I am haiving trouble figuring out what do do with the configuration steps
Enter Address of Central Storage Location for XSLT Files
and
Enter Address of Central Storage Location for Templates.
The config notes indicate that these can be a directory or network path with the format
servername\filename\.
As I understand it this is is the address of the file on the Portal Server where XSLT files and templates be stored. The problem that I am hearing from the basis team is (I am qouting an email from them) "who accesses the share? Is it the server, the client PC or both? Were running in a linux environment so I dont have any shares the PC can access."
Does anybody have any input?
Thanks,
AndyHi Andy!
I am happy that the issue is already clear!
Beeing busy makes life more interesting )
May I ask for your private mail, because I had some questions regarding your LSO implementation.
Mine is:
[email protected]
Thx in advance and have a nice day!
best regards,
Zsolt
P.S.: since I am a Moderator for SDN it is my job to keep the rules on the Forum therefore I would like to ask you to close this thread because the question - as you stated - is answered.
Thank you! -
I have a lot of trouble getting Dreamweaver 8 to transform an
QTI formatted XML. Basically, it just produces an empty page.
Here is the XSLT sample, it couldn't be simpler, the only XSL
line is bolded.
<?xml version="1.0" encoding="iso-8859-1"?><!--
DWXMLSource="test.xml" --><!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
<!ENTITY copy "©">
<!ENTITY reg "®">
<!ENTITY trade "™">
<!ENTITY mdash "—">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY pound "£">
<!ENTITY yen "¥">
<!ENTITY euro "€">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl
utput method="html" encoding="iso-8859-1"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="/">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1"/>
<title>Untitled Document</title>
</head>
<body>
<xsl:value-of select="item/@title"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Here is the QTI formatted XML (text.xml). Only one item
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<questestinterop xmlns="
http://www.imsglobal.org/xsd/ims_qtiasiv1p2">
<item ident="brgitem_test__1001" title="Commensal
microbes are commonly found within certain organs in the human
body, yet they do not cause disease. However, such microbes can act
as opportunistic pathogens if given access to other human tissue.
Which of the following species of microbes is fou">
<itemmetadata>
<qtimetadata>
<qtimetadatafield>
<fieldlabel>Subsubtopic</fieldlabel>
<fieldentry>Anaerobic flora</fieldentry>
</qtimetadatafield>
<qtimetadatafield>
<fieldlabel>Subtopic</fieldlabel>
<fieldentry>Microbiology</fieldentry>
</qtimetadatafield>
<qtimetadatafield>
<fieldlabel>Topic</fieldlabel>
<fieldentry>General Principles</fieldentry>
</qtimetadatafield>
</qtimetadata>
</itemmetadata>
<presentation>
<material>
<mattext>Commensal microbes are commonly found within
certain organs in the human body, yet they do not cause disease.
However, such microbes can act as opportunistic pathogens if given
access to other human tissue. Which of the following species of
microbes is found only as an opportunistic
pathogen?</mattext>
</material>
<response_lid ident="resp_001_01"
rcardinality="Single">
<render_choice shuffle="No">
<response_label ident="A">
<material>
<mattext texttype="text/html">
<![CDATA[<font
color="#000000"><i>Propionibacterium</i></font>]]>
</mattext>
</material>
</response_label>
<response_label ident="B">
<material>
<mattext texttype="text/html">
<![CDATA[<font
color="#000000"><i>Bacteroides</i></font>]]>
</mattext>
</material>
</response_label>
<response_label ident="C">
<material>
<mattext texttype="text/html">
<![CDATA[<font
color="#000000"><i>Pseudomonas</i></font>]]>
</mattext>
</material>
</response_label>
<response_label ident="D">
<material>
<mattext texttype="text/html">
<![CDATA[<font
color="#000000"><i>Fusobacterium</i></font>]]>
</mattext>
</material>
</response_label>
<response_label ident="E">
<material>
<mattext texttype="text/html">
<![CDATA[<font
color="#000000"><i>Clostridium</i></font>]]>
</mattext>
</material>
</response_label>
</render_choice>
</response_lid>
</presentation>
<resprocessing>
<outcomes>
<decvar defaultval="0"/>
</outcomes>
<respcondition>
<conditionvar>
<varequal respident="resp_001_01">A</varequal>
</conditionvar>
<displayfeedback linkrefid="general"/>
</respcondition>
<respcondition>
<conditionvar>
<varequal respident="resp_001_01">B</varequal>
</conditionvar>
<displayfeedback linkrefid="general"/>
</respcondition>
<respcondition>
<conditionvar>
<varequal respident="resp_001_01">C</varequal>
</conditionvar>
<setvar action="Set">1</setvar>
<displayfeedback linkrefid="general"/>
</respcondition>
<respcondition>
<conditionvar>
<varequal respident="resp_001_01">D</varequal>
</conditionvar>
<displayfeedback linkrefid="general"/>
</respcondition>
<respcondition>
<conditionvar>
<varequal respident="resp_001_01">E</varequal>
</conditionvar>
<displayfeedback linkrefid="general"/>
</respcondition>
<respcondition>
<conditionvar>
<other respident="resp_001_01"/>
</conditionvar>
<displayfeedback linkrefid="general"/>
</respcondition>
</resprocessing>
<itemfeedback ident="general">
<material>
<mattext texttype="text/html">
<![CDATA[<font color="#000000"><b>The answer
is C </b></font><font
color="#000000"><i>Pseudomonas</i></font> are
gram-negative aerobic motile rods that are not normally found
within healthy tissue. <i>Propionibacterium</i>
organisms are anaerobes found in the skin.
<i>Bacteroides</i> are anaerobes that are found in the
mouth, colon, and vagina. <i>Fusobacterium</i>
organisms are anaerobes that live in the mouth.
<i>Clostridium</i> organisms are anaerobes that are
found in the colon.]]>
</mattext>
</material>
</itemfeedback>
</item>
</questestinterop>
When I hit preview in the XSLT file, the result is a blank
page?!?!?!?!?!?
Help please!!!!!Russ,
Two XSLT 1.0 attributes that might allow you to accomplish what you want are:
<xsl:output cdata-section-elements="documentation">
This XSLT element tells the XSLT processor to always output text nodes within documentation elements as CDATA sections. Hence, with this
<xsl:output> element and the template:
<xsl:template match="documentation">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template
your original example would be output as itself:
<documentation><![CDATA[<p>Some text</p>]]></documentation>
It gets more complicated if you want to illustrate CDATA sections in your documentation element.
<xsl:value-of disable-output-escaping="yes">
tells the processor to output those special characters that are interpreted by an XML parser as themselves instead of as one of the XML representations of those characters. Thus, you can try:
<xsl:template match="documentation">
<xsl:copy>
<xsl:value-of disable-output-escaping="yes" select="."/>
</xsl:copy>
</xsl:template
--Lynne
Maybe you are looking for
-
Hello, I just received the news that Data Modeler went in production which is great news! The bad news is that it isn't free ;-) Where can I find clear information about it's pricing? Is it user or company based? Thanks, Matthias
-
New Mac - Migration Assistantat not working...metadata?
Hi there, Got myself a new Mac and Migration Assistant just didn't play ball. Not sure why - could have been me upgrading fro a 10.4 PPC G5 to Intel 10.5... Anyway, ended up dragging and dropping across the network. Got all my music, but no metadata
-
Using garageband as an FX box ?
Hello, Is there a way to input guitar into GB, process it with effects, and then output it to a guitar amp ? Thanks, Serge
-
Giving a black and white line work image a transparent background
I am working in Photoshop CS4 (mac). Currently, the image is comprised of black line on a white background. How do I go about giving the image a transparent background?
-
If I have an email with a couple pictures in it and I want to put them in my library each pictures goes into it's own roll. The same thing happens when I download from pictures from my camera or my iphone. I know have over 100 rolls and in each roll