XPath Support in XDK
Does the new XDK support XPath ?
Does the API provide classes and methods to query XML documents using XPath ?
The select methods in the XMLDocument class support XPath.
http://www.oracle.com/technology/pub/notes/technote_domparser.html
Similar Messages
-
Is XPath supported in LrXml?
Maybe it's not cause I cannot find anything about it. Can I use modules written for standard Lua 5.1 like LuaXPath?
Currently there appears to be no XPath support in the SDK.
Also, I don't think you can use LuaXPath with LrXML as LuaXPath relies on the XML DOM structure produced by LuaExpat, which is not comatible with XML DOM of LrXml. -
XSL : FO Support with XDK
IS XSL:FO support there with Oracle DOMParser? I have used Oracle XML SQ Utility from my java program to generate
XML doc from the database and I need to convert that XML doc to a PDF file.
Any pointers/code snippets regarding this is appreciated.See the built-in support for XSL:FO Rendering (using the Apache FOP XSL:FO Renderer engine) in the Oracle XSQL Pages Framework (part of the Oracle XDK for Java) in theOnline XSQL Pages Documentation
thanks. -
XPath support for Date data type.
Hi,
I am using XPathAPI class for extracting data from an XML source.I have a column in the data which has date type (any date type supported by MS SQL, Ms Access etc).I want to select only some rows from that column.I'm not aware if XPath provides operations on date types.
Is there any way I could compare two date values using XPath expressions??
thanx,
regards.After checking XPath 1.0 recommandation (http://www.w3.org/TR/xpath), I see nothing about date type support.
You will have to try little tricks, like converting 2002/09/05 into a number 20020905, making it available for < and > comparisons... -
JAXB 2.0 Support in XDK
Hello,
I am looking at replacing the jaxb-impl-2.1.5.jar and jaxb-api-2.1.jar files from Sun with Oracle versions. Are there such Oracle implementations available in a new XDK, maybe not available to the general public yet?
Thanks,
JoeHI dvohra,
I tried replacing the jaxb-impl-2.1.5.jar file with the xml.jar and xmlparserv2.jar files in the class path, but now I am getting this:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'marshaller' defined in class path resource [applicationContext4.xml]: I
f init method failed; nested exception is org.springframework.oxm.jaxb.JaxbSystemException: Unable to locate jaxb.properties for package com.oracle.mtom.schema
ception is javax.xml.bind.JAXBException: Unable to locate jaxb.properties for package com.oracle.mtom.schema
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.oracle.mtom.client.MtomServiceClient.main(MtomServiceClient.java:149)
Caused by: org.springframework.oxm.jaxb.JaxbSystemException: Unable to locate jaxb.properties for package com.oracle.mtom.schema; nested exception is javax.xml
xception: Unable to locate jaxb.properties for package com.oracle.mtom.schema
at org.springframework.oxm.jaxb.JaxbUtils.convertJaxbException(JaxbUtils.java:81)
at org.springframework.oxm.jaxb.AbstractJaxbMarshaller.convertJaxbException(AbstractJaxbMarshaller.java:143)
at org.springframework.oxm.jaxb.AbstractJaxbMarshaller.afterPropertiesSet(AbstractJaxbMarshaller.java:128)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 15 more
Caused by: javax.xml.bind.JAXBException: Unable to locate jaxb.properties for package com.oracle.mtom.schema
at javax.xml.bind.ContextFinder.searchcontextPath(ContextFinder.java:205)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:149)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:281)
at org.springframework.oxm.jaxb.Jaxb2Marshaller.createJaxbContextFromContextPath(Jaxb2Marshaller.java:311)
at org.springframework.oxm.jaxb.Jaxb2Marshaller.createJaxbContext(Jaxb2Marshaller.java:286)
at org.springframework.oxm.jaxb.AbstractJaxbMarshaller.afterPropertiesSet(AbstractJaxbMarshaller.java:125)
Do i need to set the javax.xml.bind.context.factory to an Oracle class in a jaxb.properties file in the classpath? What would the value be with the 2 jars you mentioned?
Thanks,
Joe -
Feature request: more xpath support in XMLElement
Hey guys,
Just wanted to submit a feature request. I'm trying to write code to find the number of Invocation service threads that Coherence uses. It would be very nice if I could use XPath syntax such as the following:
getSafeElement("cluster-config/services/service[@id='3']/init-params/init-param/param-value")
Since the API doesn't support that, I have to resort to something like the following:
XmlElement services = com.tangosol.net.CacheFactory.getClusterConfig().findElement(
"cluster-config/services");
List servicesList = services.getElementList();
for (Iterator i=servicesList.iterator(); i.hasNext(); ) {
XmlElement element = (XmlElement)i.next();
if (element.getAttribute("id").getInt() == 3) {
XmlElement value = element.findElement("init-params/init-param/param-value");
System.out.println("invocation threads: " + value.getInt());
}I haven't quite gotten that to work yet, but it's probably close. :)
Thanks,
MattMatt,
There is a helper function in com.tangosol.run.xml.XmlHelper class that makes it almost as easy as using the XPath.
XmlElement xmlCluster = CacheFactory.getClusterConfig();
XmlElement xmlInvocation = XmlHelper.findElement(xmlCluster,
"cluster-config/services/service/service-type", "Invocation");
XmlElement xmlThreads = XmlHelper.findElement(xmlInvocation,
"../init-params/init-param/param-value");
System.out.println("invocation threads: " + xmlThreads.getInt());Regards,
Gene -
Hi all,
I want to know if XPath is supported in parserv2 and if it is can any one point me to its documentation or API
TIA
DonnyHello Ben & Welcome to Apple Discussion,
Is this what you mean :
http://www.w3schools.com/xpath/default.asp
or http://www.stylusstudio.com/xpath.html
More info please: )
Yes, this is what I mean. I am a web developer, and would like to use Xpath to query an XML object in Javascript. In IE, I can do that with the "selectNodes" and "selectSingleNode" functions, like this:
var xpathresults = myXmlDoc.selectNodes(myXpath);
var xpathresult = myXmlDoc.selectSingleNode(myXpath);
In Mozilla, I can do that with the "evalute" function, like this:
var xpathresult = myXmlDoc.evaluate(myXpath, myXmlDoc, myNamespaceResolver, XPathResult.ORDEREDNODE_SNAPSHOTTYPE, null);
I am trying to determine if there's any way I can do that in Safari.
Thanks,
Ben -
Create xml document by xpath in java
as i know, i can navigate existing xml document by xpath in java, i wonder if i can create a xml document framework by xpath in java?
something like:
Document doc = someobject.create(xpath expression);
then i can use DOM to fill the framework?
ThanksPlease refer
http://www.packtpub.com/article/xpath-support-in-oracle-jdeveloper-xdk-11g -
Hi,
I am wondering how to incorporate support for XPath into my XML DOM app. Do I need to add another library or is support provided in any of the std Java API classes?
Thanks for help in advance,
ClaireHello
Xalan, part of the XML apache project (xml.apache.org), offers a module with XPath support (org.apache.xpath). I'm not sure, if Xalan made it into the standard version of the JDK 1.4.
If you use a XML database, the XML:DB (www.xmldb.org) api also included XPath support as an optional module.
Mathias -
I would like to parse an xml document using xpath, see:
http://www.onjava.com/pub/a/onjava/2005/01/12/xpath.html
however, in the documentation (in the link above), it states that I need J2SE 5.0.
Currently, I have:
$ java -version
java version "1.5.0_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
Does that mean that I really have to install J2SE 5.0 in order to use J2SE 5.0's XPath support? Does anybody know anything about getting started with XPath, and whether I can just use my existing version of Java? I've never used XPath.
For more documentation, one can view:
http://www.w3.org/TR/xpath20/
Thank you.I have copied the code for the xpath tutorial on
http://www.onjava.com/pub/a/onjava/2005/01/12/xpath.html
exactly as it is on the tutorial, and imported the correct jars (I think).
But still my code is giving lots of errors!
Granted its my first shot but anyway here's the code and the errors...
package test;
import org.jdom.xpath.*;
import java.io.*;
import javax.xml.xpath.*;
public class XPath {
public static void main (String [] args){
XPathFactory factory = XPathFactory.newInstance();
XPath xPath=factory.newXPath();
XPathExpression xPathExpression=xPath.compile("/catalog/journal/article[@date='January-2004']/title");
File xmlDocument = new File("/home/myrmen/workspace/Testing/test/catalog.xml");
//FileInputStream fis = new FileInputStream(xmldocument);
InputSource inputSource = new InputSource(new FileInputStream(xmlDocument));
String title = xPathExpression.evaluate(inputSource);
String publisher = xPath.evaluate("/catalog/journal/@publisher", inputSource);
String expression="/catalog/journal/article";
NodeSet nodes = (NodeSet) xPath.evaluate(expression, inputSource, XPathConstants.NODESET);
NodeList nodeList=(NodeList)nodes;
SAXBuilder saxBuilder = new SAXBuilder("org.apache.xerces.parsers.SAXParser");
org.jdom.Document jdomDocument = saxBuilder.build(xmlDocument);
org.jdom.Attribute levelNode = (org.jdom.Attribute)(XPath.selectSingleNode(jdomDocument,"/catalog//journal[@title='JavaTechnology']" + "//article[@date='January-2004']/@level"));
levelNode.setValue("Intermediate");
org.jdom.Element titleNode = (org.jdom.Element) XPath.selectSingleNode( jdomDocument,"/catalog//journal//article[@date='January-2004']/title");
titleNode.setText("Service Oriented Architecture Frameworks");
java.util.List nodeList = XPath.selectNodes(jdomDocument,"/catalog//journal[@title='Java Technology']//article");
Iterator iter=nodeList.iterator();
while(iter.hasNext()) {
org.jdom.Element element = (org.jdom.Element) iter.next();
element.setAttribute("section", "Java Technology");
XPath xpath = XPath.newInstance("/catalog//journal:journal//article/@journal:level");
xpath.addNamespace("journal", "http://www.w3.org/2001/XMLSchema-Instance");
levelNode = (org.jdom.Attribute) xpath.selectSingleNode(jdomDocument);
levelNode.setValue("Advanced");
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Type mismatch: cannot convert from XPath to XPath
The method compile(String) is undefined for the type XPath
InputSource cannot be resolved to a type
InputSource cannot be resolved to a type
NodeSet cannot be resolved to a type
NodeSet cannot be resolved to a type
NodeList cannot be resolved to a type
NodeList cannot be resolved to a type
SAXBuilder cannot be resolved to a type
SAXBuilder cannot be resolved to a type
The method selectSingleNode(Document, String) is undefined for the type XPath
The method selectSingleNode(Document, String) is undefined for the type XPath
Duplicate local variable nodeList
The method selectNodes(Document, String) is undefined for the type XPath
Iterator cannot be resolved to a type
The method newInstance(String) is undefined for the type XPath
The method addNamespace(String, String) is undefined for the type XPath
The method selectSingleNode(Document) is undefined for the type XPath
at test.XPath.main(XPath.java:12) -
Xpath and oracle business rules
Hi; are there any examples that demonstrate using XPath in a rule?
Any comments on whether oracle business rules might be a valid choice for an application that needs to enforce a set of, and varying, constraints on an incoming XML document.
Thanks for the info.
-Tim WatsonThe XPath support in the current version of Rules is for asserting portions (or all) of an XML document as facts. The Rules are then written against the elements in the XML that you are interested in.
I can't say for sure without more details, but Rules would work for enforcing constraints on XML documents. -
Hi,
I am using Oracle parser to parse my XML file, as i found that it is faster then IBM and sun parser, But i think it does not support XPath, so how can i use XPath and oracle parser, I can also use Sun parser , but dont know if it has XPath support,
So please help me outI suppose it supports DOM or a saxHandler that can provides you a DOM
tree. For Xpath, may I suggest you my solution : http://www.japisoft.com/jxpath
Regards,
A.brillant -
ANN : New Oracle XDK 10g Sample Application
Hello,
Check out this new Oracle XDK 10g Sample Application at http://otn.oracle.com/sample_code/tech/xml/index.html that demonstrates the Unicode Support of XDK using the scenario of a Real Estate Portal. This sample application also discusses the XSLT Extensions and illustrates the following features:
- Encoding XML documents in different character sets ( UTF-8, UTF-16, ISO-8859-1 )
- Sending and receiving XML documents over HTTP along with character encoding information
- Using single style-sheet for multilingual HTML page generation with the help of XSLT extension function facility provided by Oracle XDK 10g
- Storing XML documents in XMLType column of Oracle database along with appropriate encoding
- Generating XML documents on using Oracle XDK 10g DOM API's along with encoding attribute
The sample application supports two languages; English and French.
Regards,
OTN TeamI have got the following error when i run the WebServicesAssembler.jar
D:\Oracle\Oc4j\j2ee\home>java -jar d:/oracle/oc4j/webservices/lib/WebServicesAss
embler.jar -config etc/config.xml
Exception in thread "main" java.util.zip.ZipException: The system cannot find th
e path specified
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:105)
at java.util.jar.JarFile.<init>(JarFile.java:110)
at java.util.jar.JarFile.<init>(JarFile.java:52)
D:\Oracle\Oc4j\j2ee\home>java -jar WebServicesAssembler.jar -config etc/config.x
ml
Exception in thread "main" java.lang.InstantiationException: Unknown deployment
tag in JMS Web Service Example: <option>
at com.evermind.xml.XMLConfig.parseDeploymentMainNode(XMLConfig.java:293
at oracle.j2ee.ws.tools.WsAssemblerConfig.parseDeploymentMainNode(WsAsse
mblerConfig.java:68)
at com.evermind.xml.XMLConfig.parseRootNode(XMLConfig.java:268)
at com.evermind.xml.XMLConfig.init(XMLConfig.java:147)
at com.evermind.xml.XMLConfig.init(XMLConfig.java:88)
at oracle.j2ee.ws.tools.WsAssemblerConfig.init(WsAssemblerConfig.java:30
at oracle.j2ee.ws.tools.WsAssembler.main(WsAssembler.java:17) -
Hello,
Is XDK for PL/SQL exists in current version of XDK 10g?
What are the plans of Oracle about PL/SQL support for XML?
Thank you.
AlexeyXDK for PL/SQL is not supported for XDK 10g.
XDK for PL/SQL is supported for XDK 9i. -
How to use XPath with XMLBean?
Hi all,
I'm using xmlbean for a new project now, and everything was great until I tried
to use a XPath selection.
I got a "java.lang.UnsupportedOperationException: This operation requires xqrl.jar"
exception, but I could not find this jar anywhere.
I'm using the stand alone version of XMLBena. This is a small project and there
is no need for an App Server, therefore no full WebLogic 8.1
Any ideas?
Thanks,
SilvioHello Silvio -- Are you working with XMLBeans as downloaded from Apache?
XPath support in the standalone implementation of XMLBeans is limited to
simple expressions. The more sophisticated support available via xqrl.jar is
included with XMLBeans as it ships with WebLogic Platform 8.1.
Steve
"Silvio deMorais" <[email protected]> wrote in message
news:3ff9b696$[email protected]..
>
Hi all,
I'm using xmlbean for a new project now, and everything was great until Itried
to use a XPath selection.
I got a "java.lang.UnsupportedOperationException: This operation requiresxqrl.jar"
exception, but I could not find this jar anywhere.
I'm using the stand alone version of XMLBena. This is a small project andthere
is no need for an App Server, therefore no full WebLogic 8.1
Any ideas?
Thanks,
Silvio
Maybe you are looking for
-
im finishing an assignment for one of my course modules and i'ved hit a problem with part of it. i need to be able to compare three values (each the length of one side of a triangle) use this to output the type of triangle to the user for example if
-
Where do i put my order nadobeumber so i can download my adobe exportPDF
i log in and there wasn't any place to put the order number in where does it go?
-
Deployed a 2 nodes Windows 2008 R2 SP1 Failover Cluster on a HyperV 2012 Server cluster deployed on IBM HS23 blade. Disk susbsystem is IBM Storwize V7000. MPIO driver installed plus IBM DDSM. Lun presented to the VM are connected with Virtual FC Adap
-
A "friend" suggested I install Acidsearch but it seems to have mucked up my copy of Safari. It now fails to load at all. On my daughters account on the same computer all is well. I've tried removing stuff from my own Library/Safari folder, checking p
-
I want to use the value feedback provides insert into a table I've got a series of database healthcheck SQL scripts that I want to produce summary data from. Currently the scripts run in SQL*PLus and spool out results that have to be manually checked