Bug in XSLT SE?
I think I found a potential bug in the XSLT SE, but Im not sure if its a bug, and where to report it. (OpenESB / OpenJBI components?)
I am trying to use the XSLT SE, in combination with the HTTP BC to create a filter for several operations spread over various services (a canonical schema filter, if you will)
Though in all honesty, I have not gotten very far. Before I describe the situation further, I am trying all this on Glassfish v2 beta 2 (b41d) and openESB Milestone4 (though I have also tried the lastest promoted build)
Here is the situation.
There is a service, let's call it databaseservice for now. It basically has 2 operations; one 'read' operation, which returns a set of records, and one 'modify' operation, which basically modifies a few attributes on a specified record.
The idea is that there are 2 of such databaseservices, each using a slightly different SOAP message format. Now, I want to make something that collects data from these services into a central database. (not an ideal situation, but the whole use-case is too much to explain)
So, to facilitate this, I wan to create a (one or more) XSLT service(s), which translate each databaseservice's own format to a centralized format. I would post a request in teh centralized format to the XSLT service, it would translate it to the dialect for the specific server, execute the call, and translate the response back.
All sounds easy enough, and it works up to a degree. That is. If databaseservice would have had just one operation, it would have worked flawlessly. As it stands now however, I cannot get 2 operations to work.
To be more specific;
- The database service has one WSDL, with 2 operation defined it. (one porttype, and partner/role)
- The XSLT service has one WSDL file, with 2 operations, but I have also tried to use one WSDL for one operation each.
The problem that occurs is, that when I have more then 2 operations invoking the same WSDL (or partnerlink if you will) in my transformmap.xml, it always executes the 'last' defined operation in the transformmap.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<transformmap
xmlns='http://xml.netbeans.org/schema/transformmap.xsd'
xmlns:ns1="urn:centralschema">
<service
xmlns:ns1="urn:centralschema"
partnerLinkType="ns1:CentralDBServicePartnerlink"
roleName="CentralDBServicePartnerlinkRole">
<operation
opName="readOperation"
file="readOperationRequest.xsl"
transformJBI="false">
<invokes
xmlns:ns1="urn:serviceschema"
partnerLinkType="ns1:DBServicePartnerLink"
roleName="DBServicePartnerlinkRole"
opName="readOperation"
file="readOperationResponse.xsl"
transformJBI="false"/>
</operation>
<operation
opName="modifyOperation"
file="modifyOperationRequest.xsl"
transformJBI="false">
<invokes
xmlns:ns1="urn:serviceschema"
partnerLinkType="ns1:DBServicePartnerLink"
roleName="DBServicePartnerlinkRole"
opName="modifyOperation"
file="modifyOperationResponse.xsl"
transformJBI="false"/>
</operation>
</service>
</transformmap>(note, this is edited to fit example)
So, way I would want to call readOperation on the XSLT , the first transformation would already use the xsl file of the modifyOperation operation (modifyOperationResponse.xsl), this will do nasty things to our databaseservice, in return that XSLT is unable to complete the request-response operation, and timing out the request.
The only way i could see to go around this is to define seperate WSDLs for each operation, both for the centralizedserivce, as for each operation in the dbservice, but I doubt that would work well (more WSDL's binding to same address), not too mention that is just ...not very easy to maintain in a larger environment.
I hope this describes the situation Im in, and the problems Im having. Any help as to if this is a bug or not, or a solution, would be, as always, greatly appreciated.
The XSLT SE endpoints as you've defined them will resolve to a single entry in the JBI descriptor, which does not contain the operation name. One entry, one service endpoint. The single entry resolves to the last operation in the XSLT config file.
Create a unique partnerLinkRole in the WSDL for the 2nd operation. Update the XSLT config file by adding the operation with the new role. This should cause a 2nd JBI descriptor entry to be created.
Alternatively, I believe the CASA editor addresses this exact issue when 2 operations share the same partnerLinkType, role, and portType.
Regards,
Kevan
Similar Messages
-
Amount File Formatting in XSL mapping
Hi Guru(s):
I have an XSLT mapping within an File to BPM scenario. The Flat file has an amount field of 13 characters, and reads a value like 16.10, followed by trialing whitespace to fill out the 13 positions.
I am able to read this file properly with a file adapter (have content conversion), which I am mapping to a BPM input.
I have an XSLT mapping that trasnfrms the file output to the BPM input. After the transformation, sometimes, the <SignedAmount> attribute has a non-conforming output, something like: 1610.0000000000002
Is this a bug in XSLT. How can this be resolved.
BTW: I am using XI3.0 SP14.
XSLT Code snippet:
<SignedAmount>
<xsl:choose>
<xsl:when test="DebitCreditIndicator[1]='D'">
<xsl:value-of select="number(ChargeAmount[1] * '100')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="number(ChargeAmount[1] * '-1' * '100')"/>
</xsl:otherwise>
</xsl:choose>
</SignedAmount>
However, I get to see different behaviors for different nodes on the output.
In particular, note the second ISEG node:
- <ISEG>
<SignedAmount>79</SignedAmount>
</ISEG>
- <ISEG>
<SignedAmount>1610.0000000000002</SignedAmount>
</ISEG>
The Actual Output of the file adapter looks fine as below:
<Detail>
<ChargeAmount>0.79</ChargeAmount>
</Detail>
<Detail>
<ChargeAmount>16.10</ChargeAmount>
</Detail>
Thanks
FerozWhy don't you try formating the number with XSL?
<xsl:template match="/">
<html>
<body>
<xsl:value-of select='format-number(500100, "#.00")' />
<br />
<xsl:value-of select='format-number(500100, "#.0")' />
<br />
<xsl:value-of select='format-number(500100, "###,###.00")' />
<br />
<xsl:value-of select='format-number(0.23456, "##%")' />
<br />
<xsl:value-of select='format-number(500100, "#######")' />
</body>
</html>
</xsl:template>
http://www.w3schools.com/xsl/func_formatnumber.asp -
FIXED: BUG in Oracle XSLT processor
Edit: I fixed it by just importing all of the Jdev libraries. My bad for being a dolt.
I am trying to detect certain values in an XML document that start with $ (the dollar sign) character. This has some conflicts with the syntax for XSL variables. The following code gives an exception when running in the Oracle XSLT...
<xsl:template name="interpretToken">
<xsl:param name="token" />
<xsl:choose>
<xsl:when test="starts-with($token, '$')" >
<a><xsl:attribute name="href">
<xsl:value-of select='replace($token, "\$", "#")' />
</xsl:attribute>
<xsl:value-of select='replace($token, "\$", "")' />
</a>
</xsl:when>
</xsl:choose>
</xsl:template>
(note that this isn't the best way to write the above code, but replace suffices)
When I run this in the XSLT of JDev 10.1.3.2, the following stack trace is given:
Exception in thread "Thread-1" java.lang.NoClassDefFoundError: oracle/i18n/text/OraNormalizer
at oracle.xml.util.UnicodeUtil.<clinit>(UnicodeUtil.java:35)
at oracle.xml.xslt.XSLSAXPrintDriver.printAttributes(XSLSAXPrintDriver.java:492)
at oracle.xml.xslt.XSLSAXPrintDriver.startElement(XSLSAXPrintDriver.java:408)
at oracle.xml.xslt.XSLEventHandler.reportStartElement(XSLEventHandler.java:267)
at oracle.xml.xslt.XSLEventHandler.characters(XSLEventHandler.java:863)
at oracle.xml.xslt.XSLValueOf.processAction(XSLValueOf.java:143)
at oracle.xml.xslt.XSLNode.processChildren(XSLNode.java:480)
at oracle.xml.xslt.XSLCondition.processAction(XSLCondition.java:181)
at oracle.xml.xslt.XSLCondition.processAction(XSLCondition.java:157)
at oracle.xml.xslt.XSLNode.processChildren(XSLNode.java:480)
at oracle.xml.xslt.XSLTemplate.processAction(XSLTemplate.java:205)
at oracle.xml.xslt.XSLCallTemplate.processAction(XSLCallTemplate.java:132)
at oracle.xml.xslt.XSLNode.processChildren(XSLNode.java:480)
at oracle.xml.xslt.XSLCondition.processAction(XSLCondition.java:181)
at oracle.xml.xslt.XSLCondition.processAction(XSLCondition.java:157)
at oracle.xml.xslt.XSLNode.processChildren(XSLNode.java:480)
at oracle.xml.xslt.XSLTemplate.processAction(XSLTemplate.java:205)
at oracle.xml.xslt.XSLCallTemplate.processAction(XSLCallTemplate.java:132)
at oracle.xml.xslt.XSLNode.processChildren(XSLNode.java:480)
at oracle.xml.xslt.XSLCondition.processAction(XSLCondition.java:181)
at oracle.xml.xslt.XSLCondition.processAction(XSLCondition.java:157)
at oracle.xml.xslt.XSLNode.processChildren(XSLNode.java:480)
at oracle.xml.xslt.XSLTemplate.processAction(XSLTemplate.java:205)
at oracle.xml.xslt.XSLApplyTemplates.processAction(XSLApplyTemplates.java:242)
at oracle.xml.xslt.XSLApplyTemplates.processAction(XSLApplyTemplates.java:142)
at oracle.xml.xslt.XSLNode.processChildren(XSLNode.java:480)
at oracle.xml.xslt.XSLTemplate.processAction(XSLTemplate.java:205)
at oracle.xml.xslt.XSLApplyTemplates.processAction(XSLApplyTemplates.java:242)
at oracle.xml.xslt.XSLApplyTemplates.processAction(XSLApplyTemplates.java:142)
at oracle.xml.xslt.XSLNode.processChildren(XSLNode.java:480)
at oracle.xml.xslt.XSLTemplate.processAction(XSLTemplate.java:205)
at oracle.xml.xslt.XSLApplyTemplates.processAction(XSLApplyTemplates.java:242)
at oracle.xml.xslt.XSLApplyTemplates.processAction(XSLApplyTemplates.java:142)
at oracle.xml.xslt.XSLNode.processChildren(XSLNode.java:480)
at oracle.xml.xslt.XSLTemplate.processAction(XSLTemplate.java:205)
at oracle.xml.xslt.XSLApplyTemplates.processAction(XSLApplyTemplates.java:242)
at oracle.xml.xslt.XSLApplyTemplates.processAction(XSLApplyTemplates.java:142)
at oracle.xml.xslt.XSLNode.processChildren(XSLNode.java:480)
at oracle.xml.xslt.XSLTemplate.processAction(XSLTemplate.java:205)
at oracle.xml.xslt.XSLApplyTemplates.processAction(XSLApplyTemplates.java:242)
at oracle.xml.xslt.XSLApplyTemplates.processAction(XSLApplyTemplates.java:142)
at oracle.xml.xslt.XSLNode.processChildren(XSLNode.java:480)
at oracle.xml.xslt.XSLTemplate.processAction(XSLTemplate.java:205)
at oracle.xml.xslt.XSLStylesheet.execute(XSLStylesheet.java:581)
at oracle.xml.xslt.XSLStylesheet.execute(XSLStylesheet.java:548)
at oracle.xml.xslt.XSLProcessor.processXSL(XSLProcessor.java:333)
at oracle.xml.xslt.XSLProcessor.processXSL(XSLProcessor.java:181)
at oracle.xml.xslt.XSLProcessor.processXSL(XSLProcessor.java:218)
at oracle.xml.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:121)
at oracle.xml.async.XSLTransformer.run(XSLTransformer.java:136)
at java.lang.Thread.run(Thread.java:595)
No line number in my XSLT is written, but I have isolated it to the above code in the XSL file. This is some bug in the Oracle implementation, because when I run it against Saxon9, it produces output without complaint. Please help me with a work around for detecting the dollar sign and removing it for the output or can I find an oracle xslt patched package.
Thanks a lot. - astewart / [email protected]
Message was edited by:
astewart
Message was edited by:
astewart
Message was edited by:
astewartHi,
You have posted to the wrong forum. Try posting to one of the XML forums such as:
General XML
Ron -
XSLT document function - bug?
I have an XSLT stylesheet which loads several XML documents, by using the XSLT document() function.
The XSLT document() function works fine using Saxon processor and Firefox. Also it works fine in Safari 3 when the XSLT stylesheet is processed as a stylesheet referenced from an XML-file.
But, when processing the XSLT stylesheet from Javascript, in Safari 3, using xsltProcessor.transformToDocument() the document() function does not load the files. It can be added, that I am running everything from the local harddrive.
Anyone has similar experience or some workaround?
There is a similar post http://discussions.apple.com/thread.jspa?threadID=1559485&tstart=1 about Safari-Windows, but no resolution to the problem.
Message was edited by: Tomas Jonsson
Message was edited by: Tomas JonssonI have now made an example to demonstrate this bug. Firefox 3 will do the right thing, Safari 3 and 4 both have the same problem.
http://www.tomasjonsson.eu/docbugtest/docbugtest.html -
XML to CSV routine using XSLT. Oracle bugs?
I'm trying to write some XSLT so that I can apply it to any given XML using XMLTransform to generate a flattened CSV structure. My input can be any XML document, with any number of nested levels so the structure isn't known to the XSLT. I'm fairly new to XSLT but am having problem with Oracle's version of it. I've tested on both 10gR2 and 11gR2.
CSV Rules :
Adjacent fields must be separated by a comma
Embedded commas in fields are escaped e.g. 15, Maple Street => "15, Maple Street"
Embedded quotes in fields are escaped. e.g. O'Brien => "O'Brien" or John "Jonner" McNabb => "John ""Jonner"" McNabb"
Embedded CR / LF or CRLF in fields are escaped with quotes.
Records are separated with CRLF pairs
Flattening Rules :
The text of leaf elements (elements without children) are output even if they are empty
Any element with text is output
A new line occurs whenever the nesting level changes. i.e. If an element has children.
When I run the following XML and my XSLT through Oracle I get results inconsistent with results I get when I run the XML and XSLT through online XSLT utils (including W3C's test pages).
with qryXML as (
select xmltype(q'[
<email>
<to>Steve O'Brien</to>
<cc/>
<from>Jane "The Smiler" Griff</from>
<heading>Reminder</heading>
<body>Hey, don't forget me this weekend! I've enclosed some pics from last weekend
Love Jane
</body>
<attachments>
<attachment>
<filename>Dance.jpg</filename>
<encoding>MIME</encoding>
</attachment>
<attachment>
<filename>Signature.txt</filename>
<encoding/>
</attachment>
</attachments>
</email>
]') as XMLDATA from dual)
select
XMLTransform(q.XMLDATA,
xmltype(q'[
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:strip-space elements="*"/>
<xsl:template match="*[text() or not(*)]">
<xsl:if test="position() > 1">
<xsl:text>,</xsl:text>
</xsl:if>
<xsl:call-template name="display_csv_field">
<xsl:with-param name="field" select="."/>
</xsl:call-template>
<xsl:if test="not(following-sibling::*[text() or not(*)])">
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template name="display_csv_field">
<xsl:param name="field"/>
<xsl:variable name="CRLF">
<xsl:text> </xsl:text>
</xsl:variable>
<xsl:variable name="CR">
<xsl:text> </xsl:text>
</xsl:variable>
<xsl:variable name="LF">
<xsl:text> </xsl:text>
</xsl:variable>
<xsl:variable name="apos">'</xsl:variable>
<xsl:choose>
<xsl:when test="contains( $field, '"' )">
<!-- Field contains a quote. So escape -->
<xsl:text>"</xsl:text>
<xsl:call-template name="escape_quotes">
<xsl:with-param name="string" select="$field" />
</xsl:call-template>
<xsl:text>"</xsl:text>
</xsl:when>
<xsl:when test="contains( $field, ',' ) or
contains( $field, $apos ) or
contains( $field, $CRLF ) or
contains( $field, $CR ) or
contains( $field, $LF )" >
<!-- Field contains a comma, apostrophe and/or a linefeed, so quote -->
<xsl:text>"</xsl:text>
<xsl:value-of select="$field" />
<xsl:text>"</xsl:text>
</xsl:when>
<xsl:otherwise>
<!-- No need to enclose this field in quotes. -->
<xsl:value-of select="$field" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="escape_quotes">
<xsl:param name="string" />
<xsl:value-of select="substring-before( $string, '"' )" />
<xsl:text>""</xsl:text>
<xsl:variable name="substring_after_first_quote"
select="substring-after( $string, '"' )" />
<xsl:choose>
<xsl:when test="not( contains( $substring_after_first_quote, '"' ) )">
<xsl:value-of select="$substring_after_first_quote" />
</xsl:when>
<xsl:otherwise>
<!-- The substring after the first quote contains a quote.
So, we call ourself recursively to escape the quotes
in the substring after the first quote. -->
<xsl:call-template name="escape_quotes">
<xsl:with-param name="string" select="$substring_after_first_quote" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
)) from qryXML q
Output from Oracle (which appears incorrect)
"Steve O'Brien""Jane ""The Smiler"" Griff"Reminder"Hey, don't forget me this weekend! I've enclosed some pics from last weekend
Love Jane
"
Dance.jpgMIME
Signature.txt
Output from most other XSLT test environments (which appears correct):
"Steve O'Brien",,"Jane ""The Smiler"" Griff",Reminder,"Hey, don't forget me this weekend! I've enclosed some pics from last weekend
Love Jane
Dance.jpg,MIME
Signature.txt,
Oracle's XSLT handling appears incorrect in several ways:
1. There is no comma delimiter separating fields and on investigation, position() is always returning 1, which is incorrect. From XSLT reference "The position function returns a number equal to the context position from the expression evaluation context." ...."the position, or index number, of the node, relative to all the selected nodes in the node list." Therefore any node in a node list should be indexable with position. I am selecting a node list *[text() or not(*)] => Any nodes with text or with no children, yet position of each node in this list is always 1.
2. My XSLT says the output is text, yet Oracle is still using HTML character escaping which is not text! " instead of " and ' instead of '. I could search and replace, but I shouldn't have to.
Can anyone explain why Oracle's XSLT differs from other XSLT processors and offer suggestions to solve these issues. Are these bugs?Here's an example tested on 11.2.0.2 :
SQL> set scan off
SQL> set long 5000
SQL> set lines 200
SQL> var doc clob
SQL> begin
2 :doc := '<email>
3 <to>Steve O''Brien</to>
4 <cc/>
5 <from>Jane "The Smiler" Griff</from>
6 <heading>Reminder</heading>
7 <body>Hey, don''t forget me this weekend! I''ve enclosed some pics from last weekend
8 Love Jane
9 </body>
10 <attachments>
11 <attachment>
12 <filename>Dance.jpg</filename>
13 <encoding>MIME</encoding>
14 </attachment>
15 <attachment>
16 <filename>Signature.txt</filename>
17 <encoding/>
18 </attachment>
19 </attachments>
20 </email>';
21 end;
22 /
PL/SQL procedure successfully completed.
SQL> select xmlcast(
2 xmlquery(
3 'declare function local:formatField ($e as element()) as xs:string
4 {
5 let $t := ora:replace($e, """, """")
6 return if ( contains($t, """)
7 or contains($t, ",")
8 or contains($t, "'")
9 or contains($t, " ")
10 or contains($t, " ") )
11 then concat(""", $t, """)
12 else $e
13 }; (::)
14 string-join(
15 for $i in //*[*[text() or not(node())]]
16 return
17 string-join(
18 for $j in $i/*[text() or not(node())]
19 return local:formatField($j)
20 , ","
21 )
22 , " "
23 )'
24 passing xmltype(:doc)
25 returning content
26 )
27 as clob
28 ) as result
29 from dual ;
RESULT
"Steve O'Brien",,"Jane ""The Smiler"" Griff",Reminder,"Hey, don't forget me this
weekend! I've enclosed some pics from last weekend
Love Jane
Dance.jpg,MIME
Signature.txt,
We could also use a single ora:matches function in place of the OR'ed contains but it doesn't appear to work on 11.2.0.3, got an internal error :
ORA-00600: code d'erreur interne, arguments : [qmxqrs_xvm_popLastFuncArgAsStr:1], [], [], [], [], [], [], [], [], [], [], [] -
One or two XSLT/XPath bugs
I have an XSLT problem that may actually be two problems. My stylesheet works as expected in MSXML and Xalan but does very weird things in Oracle's XSLT processor. Below is the stylesheet, followed by some test input. It looks like just one bug if you run it on this test input (the "extra rows" generated get numbered 10-14 rather than 20-24, but $count and $remainder seem to have the right values). If you delete all COWS after SEQNUM 13, however, then $count and $remainder are both wrong. So it may be one bug, may be two.
XSLT:
====================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- output a CHICKENROW for each CHICKEN in the source document, and guarantee there's a positive multiple of 8 rows total -->
<xsl:template match="/">
<CHICKENROWS>
<xsl:for-each select="/COWS/COW[KEY1 = '1']">
<CHICKENROW seqnum="{SEQNUM}">
<xsl:value-of select="CHICKEN"/>
</CHICKENROW>
</xsl:for-each>
<xsl:variable name="count" select="count(/COWS/COW[KEY1 = '1'])"/>
<!-- uncomment this for debugging
<count><xsl:value-of select="$count"/></count>
-->
<xsl:variable name="remainder" select="$count mod 8"/>
<!-- uncomment this for debugging
<remainder><xsl:value-of select="$remainder"/></remainder>
-->
<!-- if we have fewer than a positive multiple of 8 rows, add empty rows -->
<xsl:if test="$count = 0 or $remainder > 0">
<xsl:variable name="startSeqnum">
<xsl:choose>
<xsl:when test="/COWS/COW[KEY1 = '1']/SEQNUM">
<xsl:for-each select="/COWS/COW[KEY1 = '1']/SEQNUM">
<xsl:if test="not(/COWS/COW[KEY1 = '1' and SEQNUM > current()])">
<xsl:value-of select=". + 1"/>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- insert as many empty rows as necessary to guarantee we have at least 8 rows and the total # of rows is a multiple of 8 -->
<xsl:call-template name="emptyRows">
<xsl:with-param name="seqnum" select="$startSeqnum"/>
<xsl:with-param name="endSeqnum" select="$startSeqnum + (8 - $remainder) - 1"/>
</xsl:call-template>
</xsl:if>
</CHICKENROWS>
</xsl:template>
<!--
Recursively insert empty rows with seqnums starting at $seqnum and going to $endSeqnum
-->
<xsl:template name="emptyRows">
<xsl:param name="seqnum"/>
<xsl:param name="endSeqnum"/>
<xsl:if test="$seqnum <= $endSeqnum">
<CHICKENROW seqnum= "{$seqnum}"></CHICKENROW>
<xsl:call-template name="emptyRows">
<xsl:with-param name="seqnum" select="$seqnum + 1"/>
<xsl:with-param name="endSeqnum" select="$endSeqnum"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
=======================================================
INPUT XML:
=======================================================
<COWS>
<COW>
<KEY1>1</KEY1>
<SEQNUM>1</SEQNUM>
<CHICKEN>ACMI2</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>2</SEQNUM>
<CHICKEN>ALTE</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>3</SEQNUM>
<CHICKEN>ANRO2</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>4</SEQNUM>
<CHICKEN>ARCO5</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>5</SEQNUM>
<CHICKEN>ARFR4</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>6</SEQNUM>
<CHICKEN>ARTRV</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>7</SEQNUM>
<CHICKEN>ASMO7</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>8</SEQNUM>
<CHICKEN>CAGE2</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>9</SEQNUM>
<CHICKEN>COUM</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>10</SEQNUM>
<CHICKEN>ERIOG</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>11</SEQNUM>
<CHICKEN>FEID</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>12</SEQNUM>
<CHICKEN>LEPID</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>13</SEQNUM>
<CHICKEN>LEPID</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>14</SEQNUM>
<CHICKEN>LEPID</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>15</SEQNUM>
<CHICKEN>LEPID</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>16</SEQNUM>
<CHICKEN>LEPID</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>17</SEQNUM>
<CHICKEN>LEPID</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>18</SEQNUM>
<CHICKEN>LEPID</CHICKEN>
</COW>
<COW>
<KEY1>1</KEY1>
<SEQNUM>19</SEQNUM>
<CHICKEN>LEPID</CHICKEN>
</COW>
</COWS>... or maybe they're not bugs at all, but if they're not, they're at least a difference in implementation from MSXML and Xalan. Do I misunderstand the XPath/XSL I'm using here? Is Oracle's interpretation equally valid?
-
XSLT bug with attributes+in memory DOM
Hello,
I know there was a thread about this one some time ago but i
don't know the current state of this matter, so :
The XSLT processor has problems with attributes when the DOM was
build dynamically (attributes are returned as being empty). When
i save the same DOM, reload it and then do the transform
attributes are properly transformed.
The Version 2.0.0.1 of the Java parser states to have solved a
problem when accessing attributes (bug #920536) but this seems to
be an other one (i tried 2.0.0.0 and 2.0.0.1 and both had this
problem).
Bye Heiko.
nullWe were unable to reproduce the problem you illustrated. We got
the output:
<HTML>
<BODY>
the value is : 1
</BODY>
</HTML>
irrespective of whether the lines were commented out. Can you
describe your environment - JRE/JDK, OS. etc?
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
You wrote:
: Hello,
: the following program illustrates what i mean :
: package testing;
: import oracle.xml.parser.v2.*;
: import org.w3c.dom.*;
: import java.io.*;
: public class XMLTest {
: public static final void main(String [] args) throws
: Exception {
: XMLDocument doc=new XMLDocument();
: doc.setVersion("1.0");
: doc.setStandalone("yes");
: Node root=doc.createElement("ROOT");
: Node att=doc.createAttribute("value");
: att.setNodeValue("1");
: root.getAttributes().setNamedItem(att);
: doc.appendChild(root);
: doc.print(new FileOutputStream("c:\\test.xml"));
: DOMParser parser=new DOMParser();
: parser.parse(new FileInputStream("c:\\test.xml"));
: doc=parser.getDocument();
: XSLStylesheet xsl=new XSLStylesheet(new
: FileInputStream("c:\\test.xsl"), null);
: XMLDocument out=new XMLDocument();
: out.appendChild(new XSLProcessor().processXSL(xsl,
doc));
: out.print(System.out);
: with the stylesheet test.xsl as follows :
: <?xml version="1.0"?>
: <xsl:stylesheet
: xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
: xmlns="http://www.w3.org/Profiles/xhtml1-transitional"
: default-space="strip"
: indent-result="yes"
: >
: <xsl:template match="ROOT">
: <HTML>
: <BODY>
: the value is : <xsl:value-of select="@value"/>
: </BODY>
: </HTML>
: </xsl:template>
: </xsl:stylesheet>
: if you run the program as given the result is :
: the value is:
: but when you uncomment the lines storing & retrieving the
: document the result is as i would expect it :
: the value is: 1
: Bye Heiko.
null -
I think xslt has some bugs. The "value-of" statement in stylesheet does'nt seem to work properly. I tried to execute the same things(with same stylesheet and xml document) outside oracle, and it is working perfectly fine. So I've created a simple-to-do experiment and put the relevant files on my homepage, and also attached a readme.txt
http://www.db.uwaterloo.ca/~nkhandel
and read readme.txt
regards
-nitin
======Here is a temporary workaround for the problem...
SQL> SELECT value(p).transform
2 (
3 dburiType('/SCOTT/STYLESHEET_TAB/ROW[ID = "1"]/SHEET/text()').getXML()
4 ).getClobVal() AS result
5 FROM nations p
6 /
RESULT
3333 -
9iR2 XSLT: disable-output-escaping bug if input is escaped
If my interpretation of XSLT standards is correct, the "disable-output-escaping" attribute in the following example should output <table width="100%"> before the first attribute of the current element, and </table> after the last one. The overall result will be a valid HTML table. This is what happens if my browser (IE 5.5 SP2) or XMLSpy does the transform.
In 9iR2 (and also in 9iR1), however, the actual output is <table width="100%"> and </table>.
Is this a (known) bug ??
Age Jan
<xsl:template match="@*">
<!-- xsl:if test="position()=1">
<xsl:text disable-output-escaping="yes"><table width="100%"></xsl:text>
</xsl:if -->
<tr class="attribute">
<td width="40"><xsl:value-of select="name(.)"/></td>
<td><xsl:value-of select="."/></td>
</tr>
<!-- xsl:if test="position()=last()">
<xsl:text disable-output-escaping="yes"></table></xsl:text>
</xsl:if -->
</xsl:template>Bug 2289449
-
XSLT Processor Bug? format-number() on large numbers
For numbers 100,000,000.00 and higher, I'm getting extra digits and rounding errors.
How can I use some custom Java code in the XSL stylesheet so the correct value is displayed (i.e. w/o rounding)? I'm getting a value of 100000000.00 and I need to insert the commas. Sometimes the correct value is displayed, other times, additional numbers are appended and the amount is rounded.The XSLT processor uses java.text.DecimalFormat under the covers as the XSLT 1.0 specification suggests. I would imagine any problems with format-number() actually boil down to problems with java.text.DecimalFormat.
You can use Java Extension functions to perform custom Java in your stylesheet.
See the file .\extfunc.html in the root directory of the XML Parser for Java V2
distribution. -
Bug when copying processing-instruction() nodes via XSLT
Hi,
Database version :
BANNER
Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - ProductionTest case (XSLT identity transform) :
SELECT XMLSerialize(document
XMLTransform(
XMLParse(document '<test><?abc?></test>')
, XMLParse(document
'<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>')
) as result
FROM dual;produces :
RESULT
<?xml version="1.0" encoding="utf-8"?>
<?abc ?><test></test>
instead of the expected output, with the processing-instruction() node at the right place, in document order :
<?xml version = "1.0" encoding = "UTF-8"?>
<test><?abc ?></test>Any ideas or workarounds?
Thanks.Yep, same on 11.2.0.3 :
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for 32-bit Windows: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
SQL>
SQL> SELECT XMLSerialize(document
2 XMLTransform(
3 XMLParse(document '<test><?abc?></test>')
4 , XMLParse(document
5 '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
6 <xsl:output method="xml"/>
7 <xsl:template match="@*|node()">
8 <xsl:copy>
9 <xsl:apply-templates select="@*|node()"/>
10 </xsl:copy>
11 </xsl:template>
12 </xsl:stylesheet>')
13 )
14 ) as result
15 FROM dual;
RESULT
<?xml version="1.0" encoding="utf-8"?>
<?abc ?><test></test> -
XSLT transformation Bug?
We are encountering a strage error and it is not always reproducible.
Problem:
content of one of the element has &; and in the initial transformation this is getting replaced by &
We are doing another transformation of this transformed xml file. This is where the transformation seems to not working correctly.
for some of the elements & is passed as is, on some of the elements , & is replaced with &#38 when ever this happens, the result will pickup all the elements after this element and treat them as text content for this element.
ex
Input1
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<item>
<company>abc &; co</company>
<addr1>1 xyz st</addr1>
<addr2>zyz zyz</addr2>
<city>xyz</city>
</item>
<item>
<company>def &; co</company>
<addr1>1 xyz st</addr1>
<addr2>zyz zyz</addr2>
<city>xyz</city>
</item>
<item>
<company>ghi &; co</company>
<addr1>1 xyz st</addr1>
<addr2>zyz zyz</addr2>
<city>xyz</city>
</item>
</Root>
Result of transformation 1
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<item company="abc & co" addr1="1 xyz st" addr2=" zyz zyz" city="xyz" />
<item company="def & co" addr1="1 xyz st" addr2=" zyz zyz" city="xyz" />
<item company="ghi & co" addr1="1 xyz st" addr2=" zyz zyz" city="xyz" />
</Root>
Result of transformation 2
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<item>
<company>abc & co</company>
<addr1>1 xyz st</addr1>
<addr2>zyz zyz</addr2>
<city>xyz</city>
</List>
</item>
<item>
<company>def &#38 co addr1="1 xyz st" addr2=" zyz zyz" city="xyz" />
<item company="ghi & co" addr1="1 xyz st" addr2=" zyz zyz" city="xyz" />
</company>
<addr1>1 xyz st </addr1>
<addr2> zyz zyz</addr2>
<city>xyz</city>
</item>
</Root>
Transformation 2 for company element some times converts & to &#38; and when it does that will pick up next item elements.
Any reason?
nullread & as &#38 in the transformed xml
-
Cannot create mysites from powershell: Original XSLT List View Web Part not found
I have a bizarre problem in my SharePoint 2013 farm. This does not occur in my test farm, only in the farm we were going to go live with.
I'm on windows Server 2012, SQLServer 2012 SP1, SharePoint 2013 April CU. 1 appserver/centraladmin server, 2 web servers.
When I log into our mysitehost and click newsfeed, it will create a mysite (even though first it displays "we are sorry there was a problem creating your site")
But from powershell, whether I use $UserProfile.CreatePersonalSite() or New-SPSite, I get the following error:
Original XSLT List View Web Part not found
So far I've only found one other person with this:
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/2503e42c-e114-4e89-8e00-89fe70f0b154/cannot-create-sharepoint-mysite-programmatically
This is a brand new farm, created with the same scripts I created my test farm with, and same version of SharePoint. Only the service accounts are different. (Farm account has admin on the servers right now since I was setting up profile service).
Some other errors from the same correlation ID that look related:
It can't seem to find the listemplate 101
And something looks wrong with the MySiteDocumentLibrary feature
I have tried the following:
1. run psconfig.exe on each server
2. install-spfeature -AllExistingFeatures
3. looped through the directory under Features and for each called Install-SPFeature $dirname -Force
4. uninstalled and reinstalled MySiteDocumentLibrary feature
5. blew away the whole farm (removed all servers from farm, deleted all databases) and recreated it.
6. tried creating the UPA from the CentralAdmin gui.
The only real difference I can think of between the working farm and non working farm is, I installed the working farm using RTM, then as they came out added the March PU and April CU. For this farm I installed RTM and March and April, and then ran my build
farm script.
I am at a loss. What do I need to do, re-install the binaries? That's all I can think of. What I love is that our test / POC system worked fine, and now 2 weeks before go-live I'm seeing errors on the production servers I've never seen before. Using the
same scripts no less.
Feature Activation: Feature 'Fields' (ID: 'ca7bd552-10b1-4563-85b9-5ed1d39c962a') was activated
Feature Activation: Feature 'CTypes' (ID: '695b6570-a48b-4a8e-8ea5-26ea7fc1d162') was activated
No document templates uploaded for list "$Resources:core,global_onet_solutiongallery_list;" -- none found for list template "100"
Failed to find <ListTemplate> tag corresponding to ID "101", tried both onet.xml for site definition ID "0" language "1033" and global site definition. Operation failed.
No document templates uploaded for list "$Resources:core,stylelibraryList;" -- none found for list template "121".
System.Runtime.InteropServices.COMException: A user may not remove his or her own account from a site collection.<nativehr>0x81020051</nativehr><nativestack></nativestack>, StackTrace: at Microsoft.SharePoint.SPUserCollection.UpdateMembers
Feature Activation: Feature 'MySitePersonalSite' (ID: 'f661430e-c155-438e-a7c6-c68648f1b119') was activated
Feature Activation: Activating Feature 'MySiteDocumentLibrary'
Calling 'FeatureActivated' method of SPFeatureReceiver for Feature 'MySiteDocumentLibrary'
SharePoint Foundation Upgrade MySiteDocumentLibraryFeatureReceiveraj08n INFO Creating new My Documents library
Unknown SPRequest error occurred. More information: 0x80070002
SPRequest.GetMetadataForUrl: UserPrincipalName=, AppPrincipalName= ,bstrUrl=http://contoso/personal/cbuchholz/DOCUMENTS ,METADATAFLAGS=59
System.IO.FileNotFoundException: <nativehr>0x80070002</nativehr><nativestack></nativestack>, StackTrace: at Microsoft.SharePoint.SPWeb.GetObjectForUrl at Microsoft.SharePoint.Portal.UserProfiles.MySiteDocumentLibraryUtil.GetSPObjectFromUrl ...
<nativehr>0x80070002</nativehr><nativestack></nativestack>There is no Web named "/personal/cbuchholz/DOCUMENTS"
Possible mismatch between the reported error with code = 0x81070504 and message: "There is no Web named "/personal/cbuchholz/DOCUMENTS"." and the returned error with code 0x80070002.
Attemping to add webpart id 0F6072F2-E804-4CFD-837E-BB37332B9D1C to web http://contoso/personal/cbuchholz
Adding XsltListViewWebPart calling SPRequest::CreateListViewPart. Web part id 0F6072F2-E804-4CFD-837E-BB37332B9D1C, web http://contoso/personal/cbuchholz
Feature receiver assembly 'Microsoft.SharePoint.Portal, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c', class 'Microsoft.SharePoint.Portal.UserProfiles.MySiteDocumentLibraryFeatureReceiver', method 'FeatureActivated' for feature 'e9c0ff81-d821-4771-8b4c-246aa7e5e9eb' threw an exception: System.InvalidOperationException: Original XSLT List View Web Part not found at Microsoft.SharePoint.Portal.UserProfiles.MySiteDocumentLibraryUtil.ReplaceListViewWebPart
Feature Activation: Threw an exception, attempting to roll back. Feature 'MySiteDocumentLibrary'
Exception in EnsureFeaturesActivatedAtSite: System.InvalidOperationException: Original XSLT List View Web Part not found
Failed to activate site-collection-scoped features for template 'SPSPERS#2' in site collection 'http://contoso/personal/cbuchholz'
Failed to apply template "SPSPERS#2" to web at URL "http://contoso/personal/cbuchholz
I've had other problems in this farm: the bug where when you add Administrators to a Search Service via the Manage Service Applications page, it removes the SPSearchDBAdmin role from the search service process account. That one did not happen in the other farm.
At least other people have that one and I could just use the farm admin instead (still troublng of course).Ok,
Here is the problem:
When creating a mysite from powershell or script, apparently you can ONLY do this from a wfe (or a server running Microsoft SharePoint Foundation Web Application in services on server).
You CANNOT create mysites from script on your appserver if it is not also a Web Application Server. I confirmed the same is true in my test farm. I guess I was always running most of these scripts on the webserver.
I searched all over and cannot find this documented anywhere.
Who do I contact to have Microsoft document this?
It's Thursday morning, I've been working non stop since Saturday morning so you don't have to :) -
Hi there,
XSLT List View displaying all the list items within the Document Library. In order to implement the Search functionality within Document library out of box "Text Filter" web part is configured as explained below. The solution is similar to
the one suggested at
http://www.wonderlaura.com/Lists/Posts/Post.aspx?ID=77
"Text Filter" Web Part added to the page.
Filter Criteria (i.e., XSLT List View columns) added to the XSLT List View where the filter parameters take the input from the "Text Filter" Web Part .
3. Both Web Parts (XSLT List View and the Text Filter) are connected.
When the search criteria is entered into the "Text Filter" Web Part, it is passed to the relevant Columns of the XSLT List View and the documents (List Items) that match the search criteria are shown within XSLT List View.
Search functionality working as expected.
Query: Selecting the "Export to Excel" icon from the ribbon generates the excel spread sheet with no data except Column Titles from the Document library. In the investigation it is
found that adding the 'Filter Criteria' on XSLT List View is causing this bug. When the Filter Criteria is removed, then "Export to Excel" functionality is working as expected.
But it is mandatory to add "Filter Criteria" to implement the search functionality with in the document library.
Help: Help/input appreciated on the work around to get the "Export to Excel" functionality work when the "Filter Criteria"
exist on the XSLT List View.
Regards,Once again thanks very much for your help Scott. very much appreciated.
In the investigation it is found that removing the 'Filter Criteria' on XSLT List View makes the "Export to Excel" functionality work. But the 'Filter Criteria' is mandatory to get the 'Document Search' functionality.
I think that due to technical limitations it should be concluded that 'only custom development can make all work, no code solutions using the SharePoint Designer can meet all the requirements.
If you can think of any alternative solution that could help in resolving the current issue or fix the issue without any custom implementation please inform. Otherwise this issue would be marked as resolved with your suggested response.
Regards, -
Error in generating a new XSL Transformer from large xslt File
Good day to all,
Currently I am facing a problem that whenever i try generating a Transformer object from TransformerFactory, I will have a TransformerConfigurationException threw. I have did some research from the net and understand that it is due to a bug that JVM memory limit of 64kb. However is there any external package or project that has already addressed to this problem? I have checked apache but they already patch the problem in Xalan 2.7.1. However I couldn't find any release of 2.7.1
Please help
Regards
RollinMaoIf you have the transformation rules in a separate XSLT file, then, you can use com.icl.saxon package to get XML files transformed. I have used this package with large XSL files and has worked well.
Maybe you are looking for
-
Ora-01031: Insufficient Privileges error during 10g install on Suse 9.1
I have tried installing Oracle 10g on Suse 9.1 Professional several times. Although I have tried to carefully follow the instructions in the installation guide, I get the following error. When the Database Configuration Assistant start during the ini
-
The starting quote marks at the end of a line in my epub file are routinely separated from the word quoted which appears on the next line. The formatting contractor accurance.com who prepared this epub file tells me that this is a feature of Adobe Di
-
Lost all contact after updating
I lost all my contact after updating my phone and can;t get them back. I did sync mu phone and also improt sims contact and still nothing. What do I do??
-
I can't activate my Apple ID......WHY???
I can't activate my Apple ID....WHY???
-
Using AppleScript to automate frame grabs?
My friend has given me a list of frames from the new Dark Knight trailer that he wishes me to grab. I know you can step through to the specific frame and Apple-C then past them into your favourite image editor, but for the number of frames he wants,