Home » Developer & Programmer » JDeveloper, Java & XML » Help with XPath in Oracle (Oracle 10g)
Help with XPath in Oracle [message #353725] Tue, 14 October 2008 21:09 Go to next message
HelloKitty79
Messages: 6
Registered: September 2008
Location: Washington, DC
Junior Member
Greetings,

I have an XML file similar to this, stored in an Oracle Table:

<Location>
<State abbr="CA">
<Building>
<Department>Department A</Department>
<City>Phoenix</City>
<Code>DLD293</Code>
<Status>Released</Status>
</Building>
</State>
</Location>

I also have an XSL similar to this, stored in the table also:


<h1>The (<xsl:value-of select="Location/State/Building/Department" /> of <xsl:value-of select="Location/State/Building/City" />, <xsl:value-of select="Location/State" /></h1>


This worked find in XML spy, and in Dreamweaver. But then, I needed to migrate the code and store in an Oracle table. For some reason, when I try to transform to HTML using the query below, Oracle does not agree with this code. I have been trying to use XPath, but it's not working.

SELECT XMLTRANSFORM(xml.code, xsl.code).GetClobVal()
FROM code xml, code xsl
WHERE xml.code = 1000
and xsl.code = 2000;

The query runs fine, but no data is extracted from the XML. What should I do here? Any help is greatly appreciated.

[Updated on: Tue, 14 October 2008 21:10]

Report message to a moderator

Re: Help with XPath in Oracle [message #353740 is a reply to message #353725] Tue, 14 October 2008 23:33 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Use SQL*Plus and copy and paste your session.

Post a test case: create table and insert statements along with the result you want with these data.

Regards
Michel
Previous Topic: patch power objects
Next Topic: Problem with ADF PanelPage
Goto Forum:
  


Current Time: Thu Mar 28 18:31:04 CDT 2024