Generate xpath expression from xslt
How can I generate an xpath expression for a selected node within xslt? I've found ways to get the node name, it's number and so on, but there doesn't seem to be a simple way to just print out the nodes xpath ( besides writing some type of recursive template )
The application is to set an HTML <input/> fields name attribute to the XPATH. That way, from within my app I can catch the update values and apply using XPATH.
Typically you will be using the XSLT functions like position(), for the actual position of the node and of course other XSLT axis specifiers like ancestor, sibling, descendant, etc. For more info go to http://www.mulberrytech.com and http://www.zvon.org for tutorials.
Hope this helps
Similar Messages
-
Using a xpath expression stored in a variable
Hi All,
I have an xpath expression which is stored in the database which I need to use against the request XML. I am able to retrieve this Xpath expression from the database, but not able to use it against the request XML.
Xpath expression got from the database is: /request/param//name.
I have tried $body/$XpathVariable, this does not work. I can not hard code this expression during my design time, so the details of the expression has to be fetched at run time.
Any ideas to get the value would helpful.
Thankstry to assign this value to a temp variable and then in the XqueryExpression try to retrieve it starting with "//"
-
In XSLT, make XPath expression to retrieve attribute nodes
I have a problem fetching attribute nodes in an Xpath expression.
SOAP Request:
<Create ID=5/>
<Name>Per</Name>
I want to fetch the value of ID and put it into another variable with an XPath expression in a XSLT transformation.
If you look at http://www.w3schools.com/xpath/xpath_syntax.asp
You should be able to do this with "//Create[@ID]" according to the examples, but this is not working at all in JDev.
Any thoughts?
/PerThanks, that worked!
Just thought about it. How do you do the other way around.
<Create>
<ID>7</ID>
to
<Create ID=7>
. -
1.1 Description of the Workflow
We have designed a Workflow, which has an init form HighLevelQuestionnaire.
1. The user attempts to start the workflow by submitting this form, which has an XML schema embedded.
2. When user submits the data, we set workflow variables to fetch data from the init-form and all the values entered by the user are stored in the database.
3. Based on the values, value of Risk Level is calculated to be either High or Medium, and user is routed to one of the two routes.
4. The user QPAC is used to show the next form to the user.
Another form has been designed called AssessRisk in which user is asked to confirm the Risk Level.
5. At this point, we use Script QPAC to print the values in the log.
1.2 Problem description
1. In the Point No. 6 of the workflow, the values are not printed in the log. A blank space is printed instead.
2. Initially, we embedded the schema in the form. But when values were not printed, we removed the schema. Even then it didnt work.
1.2.1 User QPAC Specifications
Properties of user QPAC used in Step 4 of the workflow
Mappings Tab: -
Input Variable --- No variable
Template URL ----- Form11.xdp
Output Variable ---- myform
Myform is a form-variable, which has template URL as Form11.xdp
1.2.2 Script QPAC
1.2.2.1 With XML Schema embedded
import com.adobe.workflow.pat.service.*;
System.out.println("----------- High Level Questions -----------");
System.out.println("--1- the RiskLevel is: " + patExecContext.getProcessDataStringValue("/process_data/myform/form-data/data/xdp/dataset s/data/RiskLevel/general/Risk_Level") + " @@@@@");
Note:- Here RiskLevel is the schema root of myform and Risk_Level is the schema variable mapped with textfield on the form
1.2.2.2 Without XML Schema embedded
System.out.println("--1.1- the RiskLevel is: " + patExecContext.getProcessDataStringValue("/process_data/myform/form-data/data/xdp/dataset s/data/fields/Risk_Level") + " @@@@@");
1.2.2.3 Conclusion
In both the cases, a blank value is printed. In both the cases, we get some output which is when we use
System.out.println("--1.1- the RiskLevel is: " + patExecContext.getProcessDataStringValue("/process_data/myform/form-data/data/xdp/dataset s/data ") + " @@@@@");
In this case all the values are printed with space in between.
This is the basic feature which has to be used while developing workflows.Hi
You might want to try using VariableLogger, at:
http://www.avoka.com/avoka/qpac_library.shtml
It's a little more reliable than the script QPAC, especially if one of your xpath expressions is wrong.
Please note that embedding the schema makes no difference in how the data from the form is stored. What makes the difference is whether your fields are bound to specify schema elements, or whether they use the "normal" binding.
Howard -
Can not construct xml from relative xpath expression: //FormVar
In version 7.0, it was possible to access Form Variables with the (valid) XPath Expression "//FormVariable".
In 7.2.2, using this XPath Expression leads to a stalled action, with message: "can not construct xml from relative xpath expression: //FormVar". (see full stack trace below)
What's wrong? How can I fix this?
Use of relative expression is very very useful during the development phase!
Best Regards,
com.adobe.workflow.WorkflowRuntimeException: can not construct xml from relative xpath expression: //FormVar
at com.adobe.workflow.pat.service.PATExecutionContextImpl.createNodesForXPathExpression(PATE xecutionContextImpl.java:854)
at com.adobe.workflow.pat.service.PATExecutionContextImpl.setProcessDataValue(PATExecutionCo ntextImpl.java:707)
at com.adobe.workflow.pat.service.PATExecutionContextImpl.setProcessDataWithExpression(PATEx ecutionContextImpl.java:429)
at com.adobe.workflow.qpac.set_value.SetValueService.execute(SetValueService.java:72)
at com.adobe.workflow.engine.PEUtil.executeAction(PEUtil.java:184)
at com.adobe.workflow.engine.ProcessEngineBMTBean.continueBranchAtAction(ProcessEngineBMTBea n.java:2371)
at com.adobe.workflow.engine.ProcessEngineBMTBean.asyncInvokeProcessCommand(ProcessEngineBMT Bean.java:512)
at sun.reflect.GeneratedMethodAccessor709.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta iner.java:683)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:185)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:1 44)
at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance Interceptor.java:72)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:120)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor. java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331 )
at org.jboss.ejb.Container.invoke(Container.java:723)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:359)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
at $Proxy285.asyncInvokeProcessCommand(Unknown Source)
at com.adobe.workflow.engine.ProcessCommandControllerBean.onMessage(ProcessCommandController Bean.java:127)
at sun.reflect.GeneratedMethodAccessor641.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.j ava:458)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:185)
at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterc eptor.java:62)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:90)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:372)
at org.jboss.ejb.Container.invoke(Container.java:723)
at org.jboss.ejb.plugins.jms.JMSContSorry, i just read my own message in the discussion forum and
discovered all spaces for formating the XML tags where gone.
It should look like this:
[-----xml_type---]
<doc>
__<role>
____actor
____<first>
______john
____</first>
____<last>
______bond
____</last>
__</role>
__<role>
____actor
____<first>
______james
______</first>
____<last>
______smith
____</last>
__</role>
</doc>
semantic:
There are two actors: "john bond" and "james smith"
Querying for "john bond" succeedes which is correct
Querying for "james smith" succeedes which is correct
Querying for "james bond" fails which is correct
Querying for "john smith" succeedes which is an ERROR!
contains(xdata, 'actor INPATH(//role[./first = "john" and ./last
= "smith"])' (= 100 ---> ERROR!)
bye,
feri -
Xpath Expression/Functions in XSLT Mapper
Manual says I can use the orcl functions as well as Xpath Expressions, but when I try to execute it does not work? am I missing something her?
Trying to get a variable data into the target schema , the var is not in the source data schema?
Any suggestions?Can you explain a bit more what you want to do. It's very vague right now. Probably will be able to help you out.
Thanks -
Extracting node value from XPath Expression in OSB Conditional Branch
HI All
While using conditional branch in OSB,i only get an XPath Expression editor to set a variable used to test a condition.
Now let's say my request is
<Body>
<exam:PersonSearchReq xmlns:exam="http://www.example.org">
<exam:RequestorSSO>James</exam:RequestorSSO>
</exam:PersonSearchReq>
</Body>
I write my XPath expression as :
./exam:PersonSearchReq/exam:RequestorSSO/text()
Now if I test this using the tester application , insted of getting node value 'James' ,i get the entire node element ,i.e
<exam:RequestorSSO xmlns:exam="http://www.example.org">James</exam:RequestorSSO>
Please suggest how can i extract the text value.
Regards,
ChinmayHi Guys
Actually it turns out that you need to populate In-Variable to function is correctly.As soon as i entere 'body' in it,it worked fine.
Thanks
Chinmay -
NullPointerException when processing *[*] xpath expression
I'm trying to pull only elements that have an element as a
child, using the *[*] xpath expression. When I use MSXML 3.0,
my results are correct. When I use ORAXSL (NT 9i version
downloaded from OTN), I get a NullPointerException. Please see
example below.
<?xml version="1.0"?>
<TABLES>
<TABLE1>
<TABLE1_ROW1>TEXT1</TABLE1_ROW1>
<TABLE1_ROW2>TEXT2</TABLE1_ROW2>
</TABLE1>
<TABLE2>
<TABLE2_ROW1>TEXT3</TABLE2_ROW1>
</TABLE2>
<TABLE3>
<TABLE3_ROW1>TEXT4</TABLE3_ROW1>
</TABLE3>
</TABLES>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" version="1.0" encoding="UTF-8"
indent="yes"/>
<xsl:key name="elements" match="*[*]" use="name()"/>
<xsl:template match="/">
<xsl:for-each select="//*[generate-id(.)=generate-id(key
('elements',name())[1])]">
<xsl:for-each select="key('elements',name())">
<xsl:if test="position()=1">
<xsl:text>drop table </xsl:text>
<xsl:value-of select="name()"/>
<xsl:text>;
</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
<xsl:text>
exit</xsl:text>
</xsl:template>
</xsl:stylesheet>
MSXML 3.0 OUTPUT:
drop table TABLES;
drop table TABLE1;
drop table TABLE2;
drop table TABLE3;
exit
ORAXSL OUTPUT:
java.lang.NullPointerException
Error occurred while processing test.xml: null
If I change the *[*] to just * then the XSLT will process.This is a bug. I've filed Bug 2138361 to get this looked into by
development.
The workaround is to avoid using keys, moving the *[*] into the
outer select expression for the for-each:
<xsl:for-each select="//*[*]">
instead of:
<xsl:for-each select="//*[*][generate-id(.) =
generate-id(key('elements',name())
[1])]"> -
Using the variable ? operator in an XPath Expression
I'm trying to using the variable operator (?) in an Oracle prepared statement used in a query where clause. Here is the query:
select xt.APPLICATION_NAME, xt.VERSION, xt.EVENT_TYPE, xt.SENDING_SITE, xt.RECEIVING_SITE, xt.EVENT_ID
from AUDITED_EVENT_XML_MIN e,
XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
'/xae:auditable-event'
PASSING e.xml_event_content
COLUMNS
APPLICATION_NAME VARCHAR2(255) PATH 'xae:application-name',
VERSION VARCHAR2(255) PATH 'xae:version',
EVENT_TYPE VARCHAR2(255) PATH 'xae:event-type',
SENDING_SITE VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.4/HD.2',
RECEIVING_SITE VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.6/HD.2',
EVENT_ID VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.10') xt
where existsNode(E.XML_EVENT_CONTENT, '/xae:auditable-event[xae:event-type=?]','xmlns:xae="http://gov/va/med/datasharing/audit/endpoint/audit"') = 1This code works when the ? is replaced with "aValue". I need to use the ? so that my Java client can pass a variable value into the query.
Is this a supportable feature or am I doing something wrong?
I didn't see any examples in the Oracle XML DB Developers Guide where there was a ? in an XPath expression.
I also tried "?" with the same issue...
Here is the version info:
SQL*Plus: Release 11.1.0.6.0 - Production on Mon Sep 10 18:41:55 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optionsAny assistance would be greatly appreciated.
Thanks in advance...I incorporated this suggestion and it worked very well. Thanks!
Now I have converted my solution to use a structured index. As such, I want to write the where clauses in terms of column names rather than XPath expressions.
I hoped it was as simple as changing the code that generates the XPath expression to generate a SQL expression. After making that change, I'm now getting this error:
Caused by: java.sql.SQLSyntaxErrorException: ORA-00920: invalid relational operator
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:686)
at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:617)
at oracle.jdbc.driver.T2CPreparedStatement.executeForDescribe(T2CPreparedStatement.java:559)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1077)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3381)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3425)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1490)
at gov.va.med.datasharing.audit.dao.jdbc.runner.MapQueryRunner.run(MapQueryRunner.java:47)
at gov.va.med.datasharing.audit.web.dao.jdbc.AuditableEventsQueryDAOImpl.getAuditableEventsByDate(AuditableEventsQueryDAOImpl.java:150)It seemed to me that if it worked for the XPath expression that it should also work for the SQL expression.
The static SQL is:
SELECT PK_ID, EVENT_TYPE, OUTCOME, SENDING_SITE, RECEIVING_SITE, CREATED_TIME, EVENT_ID, PATIENT_ID FROM
(SELECT rownum as rn, PK_ID, EVENT_TYPE, OUTCOME, SENDING_SITE, RECEIVING_SITE, CREATED_TIME, EVENT_ID, PATIENT_ID FROM
(SELECT aet.AUDITABLE_EVENT_XML_PK_ID AS PK_ID, xt.EVENT_TYPE, xt.OUTCOME, xt.SENDING_SITE, xt.RECEIVING_SITE, aet.CREATED_TIME as CREATED_TIME, xt.EVENT_ID, xt.PATIENT_ID
FROM AUDITABLE_EVENT_XML aet,
XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
'/xae:auditable-event'
PASSING aet.xml_event_content
COLUMNS
EVENT_TYPE VARCHAR2(255) PATH 'xae:event-type',
SENDING_SITE VARCHAR2(255) PATH 'xae:sending-site',
RECEIVING_SITE VARCHAR2(255) PATH 'xae:receiving-site',
EVENT_ID VARCHAR2(255) PATH 'xae:event-id',
PATIENT_ID VARCHAR2(255) PATH 'xae:patient-id',
OUTCOME VARCHAR2(255) PATH 'xae:outcome') xt
WHERE aet.CREATED_TIME BETWEEN ? AND ?
AND ?
) ORDER BY CREATED_TIME desc
) WHERE rn > ? and rn <= ?So I'm thinking that Oracle must perform strong checking in SQL, not allowing the '=' operator to be substituted. If I run this query in Toad, replacing the ? with the SQL, it runs fine...
Can someone tell me whether or not this is a legal substitution?
The SQL that runs in Toad is:
SELECT PK_ID, EVENT_TYPE, OUTCOME, SENDING_SITE, RECEIVING_SITE, CREATED_TIME, EVENT_ID, PATIENT_ID FROM
(SELECT rownum as rn, PK_ID, EVENT_TYPE, OUTCOME, SENDING_SITE, RECEIVING_SITE, CREATED_TIME, EVENT_ID, PATIENT_ID FROM
(SELECT aet.AUDITABLE_EVENT_XML_PK_ID AS PK_ID, xt.EVENT_TYPE, xt.OUTCOME, xt.SENDING_SITE, xt.RECEIVING_SITE, aet.CREATED_TIME as CREATED_TIME, xt.EVENT_ID, xt.PATIENT_ID
FROM AUDITABLE_EVENT_XML aet,
XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
'/xae:auditable-event'
PASSING aet.xml_event_content
COLUMNS
EVENT_TYPE VARCHAR2(255) PATH 'xae:event-type',
SENDING_SITE VARCHAR2(255) PATH 'xae:sending-site',
RECEIVING_SITE VARCHAR2(255) PATH 'xae:receiving-site',
EVENT_ID VARCHAR2(255) PATH 'xae:event-id',
PATIENT_ID VARCHAR2(255) PATH 'xae:patient-id',
OUTCOME VARCHAR2(255) PATH 'xae:outcome') xt
WHERE aet.CREATED_TIME BETWEEN TO_DATE ('9/19/2011 12:00:01 AM','MM/DD/YYYY HH:MI:SS PM')
AND TO_DATE ('12/20/2012 12:00:00 AM','MM/DD/YYYY HH:MI:SS PM')
AND (OUTCOME=0 or OUTCOME=1)
) ORDER BY CREATED_TIME desc
) WHERE rn > 0 and rn <= 5;Any assistance will be appreciated,
Thanks in advance. -
XPath Expression won't evaluate
Hi,
I am using the ora:doc() function to read an xml and XPath to get extract particular values from it. The issue is that the XPath expression doesnt evaluate correctly on Oracle BPEL process manager where as the same expression is being evaluated correctly in XMLSPY with XPath 1.0.
The XML that I am trying to read is of the format
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2006 U (http://www.altova.com)-->
<n:CHNotification xmlns:n="http://www.example.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org
C:\OraBPELPM_1\integration\jdev\jdev\mywork\BPELWorkspace\testXML\CallHomeNotification.xsd">
<Notification id="String">
<n:mailto>String</n:mailto>
<n:mailcc>String</n:mailcc>
<n:subject>String</n:subject>
<n:body>String</n:body>
<n:additionalbody>String</n:additionalbody>
</Notification>
<Notification id="String32432">
<n:mailto>String</n:mailto>
<n:mailcc>String</n:mailcc>
<n:subject>String</n:subject>
<n:body>String</n:body>
<n:additionalbody>String</n:additionalbody>
</Notification>
</n:CHNotification>
The function being used in OracleBPEL Process manager is
ora:doc('${server_url}/xmllib/notification.xml', //Notification[@id="String"]/n:mailto)
Can somebody please tell me where I could be going wrong?....It'll be a great help.
Thanks,
GunjanI have the same problem posted in the constants discussion
Hi
I am trying out the xml file solution. I have places an XML-file in the xmllib location. The file has the following content :
<?xml version="1.0" encoding="UTF-8">
<bpel-domain>
<preferences>
<property name="defaultRentepercentage"> 0.3 </property>
</preferences>
</bpel-domain>
In the Assign step in BPEL I do the following
orcl:lookup-xml('http://localhost:9700/orabpel/xmllib/trials-properties.xml', '/bpel-domain/preferences/property[@name="defaultRentepercentage"]')
The error I get when running this is the following
XPath expression failed to execute.
Error while processing xpath expression, the expression is "orcl:lookup-xml("http://localhost:9700/orabpel/xmllib/trials-properties.xml", "/bpel-domain/preferences/property[@name="defaultRentepercentage"]")", the reason is ExtFuncFunction.
Please verify the xpath query.
I have tried the xpath expression in XMLSpy, and there it seems to work
Am i missing something ? -
Xpath expression for a custom SearchBoxEx WebPart to a DataFormWebPart
Hi all,
I have a custom search webpart that has asp controls that are used in my dataview (DataFormWebPart) for retreiving data. This data view has the xslt variable "Rows" with the following xpath expression:
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[
(contains(translate(@Title,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'), translate($FilterName,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')) or $FilterName = '')]"/>
*<ParameterBinding Name="FilterName" Location="Control(txtName)" DefaultValue=""/>
This webpart searchs for people by their name. For example:
search for:
jose
results:
jose luis escudero
jorge jose torres
Ok, it works fine there, but what if I want to search for: jose escudero. There won't be any results because the search xpath expressions has a contains function for what you write in the textbox control.
So I think it should be splited by " " and searchs for the each word in the @Title column of the data source.
I don't master xpath expressions so I don't know how to code a correct xpath expression for that, any idea? I would greatly appreciate any help. Thanks.Hi betozg31,
According to your description, the point is that your Xpath code put the “jose escudero” search keyword as a unitary string. So your search would not return any results. I think
if you want to search result using two or more keywords ,you need to deal with the keywords firstly. Separating from the “jose escudero” search keyword , getting “jose” search keyword and “escudero” search keyword. Here is a simple code you
can have a look:
<xsl:if test="$FilterName =' ' ">
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[ $FilterName=' ']"/>
</xsl:if>
<xsl:variable name="FormatFN" select="lower-case(normalize-space($FilterName))"/>
<xsl:variable name="FormatT" select="lower-case(@Title)" />
<xsl:if test="matches($FormatFN,' ')">
<xsl:variable name="FilterNameBefore" select="substring-before($FormatFN,' ')"/>
<xsl:variable name="FilterNameAfter" select="substring-after($FormatFN,' ')"/>
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[ contains(contains($FormatT, $FilterNameBefore),$FilterNameAfter )]"/>
</xsl:if>
<xsl:if test="not(matches($FormatFN,' '))">
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[ contains($FormatT,$FormatFN)]"/>
</xsl:if>
Hope this helps!
Best Regards,
Eric
Eric Tao
TechNet Community Support -
Xpath expression not working with xmlparserv2 10.x jar in websphere application server 8
Hi,
I am using xmlparserv2 10.x jar in websphere application server to transform xml. Due to some unknown reason we are seeing inconsistent result for the xpath expression we used inside the xslt.
.|following-sibling::* This is the xpath expression we use.
the meaning of the expression is to union the current node and the following siblings of the current node. But while rendering the page( a servlet) for first two times it gives the expected result. From the third time, it is giving unexpected results. It is missing the first node in the following-sibling::* So it just results in current node and misses the next node and then combine the nodes following the next node.
For example when executing the above expression on the node A , it should result A B C D. It is returing correctly for first 3 times. From the 4th time it just results A C D and misses B.
<root>
<A />
<B />
<C />
<D />
</root>
But it giving results consistently when using xmlparserv2 9.x jar. But it is not 1.5 compliant.
Pleas help!..
Thanks,
SP.If you are new to JSF, then I'd try and simplify the environment in which you are working as the first step to achieving a successful outcome.
JSF 1.2 is a certified and well tested component of WLS, so we know it works. I'm not sure of the effect of all those additional modules you are adding in there -- it appears as if you have gotten a Faces implementation instantiated, but there could be some form of version difference/conflict since it can't find a method its looking for.
Using Oracle Enterprise Pack for Eclipse (http://www.oracle.com/technology/software/products/oepe/oepe_11115.html) you can build yourself out a pretty simple JSF application to get started from and deploy it to a WLS server. This would remove all the additional libraries you currently have, provide you with a bundled applicaton to deploy and give you a pretty good environment from which you can learn and experiment with JSF.
-steve- -
We are using the OAGis schema and a client is sending us data in an expression instead of in the actual schema location using the <Get> portion of the schema.
<Get uniqueIndicator="true">
<Expression expressionLanguage="XPath">//Credit/FirstName[.="John"]</Expression>
<Expression expressionLanguage="XPath">//Credit/LastName[.="Smith"]</Expression>
</Get>What is the best way in BPEL to evaluate this xpath expression to set the FirstName to John and LastName to Smith? We are currently using a transform to parse each expression using XSLT into our database schema. It's not very elegant because it uses an if statement to check the path then has to parse out between the quotes then passes the value to the new var/schema.
It seems like there should be a way to evaluate the XPath and set the path to the noted string.
Thanks,This Example works fine for arrays that are part of a WSDL message.
But in 10.1.3.1 this does not work with a array that is part of an XSD declaration
for Example XSD snippet
<xsd:element name="itemList">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="1" ref="tns:Item" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
using the following in assign statement
<copy>
<from expression="concat('/ns9:itemList/ns9:Item[',string(bpws:getVariableData('index')),']')"/>
<to variable="idxXpath"/>
</copy>
<copy>
<from expression="bpws:getVariableData('OutputItemList',bpws:getVariableData('idxXpath'))"/>
<to variable="idx_item"/>
</copy>
gives a compiler error that is
Error(176):
[Error ORABPEL-10085]: invalid argument
[Description]: in line 176 of "D:\OnlineShopping_1\bpel\OnlineShopping.bpel", the second argument "bpws:getVariableData("idxXpath")" for getVariableData is not a literal expression.
[Potential fix]: Please correct the second argument, you might need to escape using single quote or " to make it literal.
Can anyone site the reason for the same or a possible solution?
Message was edited by:
user607972 -
Accessing BPEL Variables from XSLT
How can I access the BPEL process vaiable values from an XSL transformation
This causes a problem with the XSL Mapper. If I try to add an XPath-expression component to use this function I get the Warning message :-
"Function of name "bpws:getVariableData" not found."
If I continue, the following XSL segment is generated :-
<tns:comment>
<xsl:value-of select="bpws:getVariableData(?,?,?)"/>
</tns:comment>
This compiles ok, but when I run the business process, I get the following error from the transformation component :-
XPath expression failed to execute. Error while processing xpath expression, the expression is "ora:processXSLT("transformDimToRAN.xsl", bpws:getVariableData("invokeDimensionGateway_getFutOptTradesSelect_lastProcessedTradeRef_OutputVariable", "FutOptTradesCollection"))", the reason is Extension function http://schemas.xmlsoap.org/ws/2003/03/business-process/ : getVariableData is unknown. Please verify the xpath query. -
Using the variable placeholder ? in an XPath expression
I'm trying to using the variable operator (?) in an Oracle prepared statement used in a query where clause. Here is the query:
select xt.APPLICATION_NAME, xt.VERSION, xt.EVENT_TYPE, xt.SENDING_SITE, xt.RECEIVING_SITE, xt.EVENT_ID
from AUDITED_EVENT_XML_MIN e,
XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
'/xae:auditable-event'
PASSING e.xml_event_content
COLUMNS
APPLICATION_NAME VARCHAR2(255) PATH 'xae:application-name',
VERSION VARCHAR2(255) PATH 'xae:version',
EVENT_TYPE VARCHAR2(255) PATH 'xae:event-type',
SENDING_SITE VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.4/HD.2',
RECEIVING_SITE VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.6/HD.2',
EVENT_ID VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.10') xt
where existsNode(E.XML_EVENT_CONTENT, '/xae:auditable-event[xae:event-type=?]','xmlns:xae="http://gov/va/med/datasharing/audit/endpoint/audit"') = 1This code works when the ? is replaced with "aValue". I need to use the ? so that my Java client can pass a variable value into the query.
Is this a supportable feature or am I doing something wrong?
I didn't see any examples in the Oracle XML DB Developers Guide where there was a ? in an XPath expression.
I also tried "?" with the same issue...
Here is the version info:
SQL*Plus: Release 11.1.0.6.0 - Production on Mon Sep 10 18:41:55 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optionsAny assistance would be greatly appreciated.
Thanks in advance...
Edited by: flyeagle5683 on Sep 10, 2012 5:49 PMselect xt.APPLICATION_NAME, xt.VERSION, xt.EVENT_TYPE, xt.SENDING_SITE, xt.RECEIVING_SITE, xt.EVENT_ID
from AUDITED_EVENT_XML_MIN e,
XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
'/xae:auditable-event'
PASSING e.xml_event_content
COLUMNS
APPLICATION_NAME VARCHAR2(255) PATH 'xae:application-name',
VERSION VARCHAR2(255) PATH 'xae:version',
EVENT_TYPE VARCHAR2(255) PATH 'xae:event-type',
SENDING_SITE VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.4/HD.2',
RECEIVING_SITE VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.6/HD.2',
EVENT_ID VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.10') xt
where XMLEXISTS(
'declarre namespace xae ="http://gov/va/med/datasharing/audit/endpoint/audit"; (: :)
$XML/xae:auditable-event[xae:event-type=$VALUE]'
passing e.xml_event_content as "XML",
:1 as "VALUE"
) or you can do
select xt.APPLICATION_NAME, xt.VERSION, xt.EVENT_TYPE, xt.SENDING_SITE, xt.RECEIVING_SITE, xt.EVENT_ID
from AUDITED_EVENT_XML_MIN e,
XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
'/xae:auditable-event'
PASSING e.xml_event_content
COLUMNS
APPLICATION_NAME VARCHAR2(255) PATH 'xae:application-name',
VERSION VARCHAR2(255) PATH 'xae:version',
EVENT_TYPE VARCHAR2(255) PATH 'xae:event-type',
SENDING_SITE VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.4/HD.2',
RECEIVING_SITE VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.6/HD.2',
EVENT_ID VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.10') xt
WHERE EVENT_TYPE = :1Edited by: mdrake on Sep 10, 2012 7:23 PM
Edited by: mdrake on Sep 10, 2012 7:24 PM
Maybe you are looking for
-
i have a report with many pages > 10 and i run it in the browser with htmlcss format my problem is that the first pageis good but after the title is down and the third is more down so after 6 or 7 pages the title is in the middle of the page how can
-
Is it possible to restrict the ability to e-mail a pdf outside a specific domain name?
Hello, I am trying to find a solution to a friends problem. She has a quarterly publication that she sends out to big banks and financial institutions. Recently she has had some problems with press leaks. I am trying to find some security options
-
Ipod not showing up in itunes or my computer
My ipod is new (3gen nano) i can't get it to show up in my computer or in itunes i have no device on my left pane of itunes i only have library, store and playlist. i am running windows xp
-
Why would an alias file be larger than the original file?
I have a simple document that is 106kb. When I create an alias to the file, the alias is 133kb. Why would the alias file be larger than the orginal file when the alias file is simply a redirect to the original file?
-
hiye, i'm very new to oracle, been using ms sql for the past 4 years. and oracle is very new to me. everything is just so different. expected things to be as easy at ms sql. but i was wrong. so wrong. here;s the first newbie question, how the heck do