What is an XNode?
An XNode is an XML node full of programming metadata. Consider the following XNode sample for obtaining a list of people from a database.
<x:execute-sql>
<connection driver="com.mysql.jdbc.Driver" password="password" url="jdbc:mysql://some_host:3306/some_db" user="root" />
<statement returnrows="People/Person">select * from person where lname like concat('%',?,'%')</statement>
<param binddir="1" ref="srch_cri" type="Varchar2" />
</x:execute-sql>
This XNode would query the connection defined at the
connection
node, execute the select
statement
with the parameter referenced at the path
srch_cri
and return a nodeset of results at the path at
People/Person
.
|
|
XNode Reference
What we have here is hardly documentation yet. Consider it a place holder
and some formatting experimentation until we have time to get this written.
<
x:node
class
="org.xeml.util.XConnectionManager"
>
<
pooled-connection
driver
="com.mysql.jdbc.Driver"
maxconn
="3"
name
="conn1"
password
="mypassword"
url
="jdbc:mysql://myserver.com:mydb/mydb"
user
="myuser"
/>
<
pooled-connection
driver
="com.mysql.jdbc.Driver"
maxconn
="10"
name
="conn3"
password
="mypassword"
url
="jdbc:mysql://myotherserver.com:3306/myotherdb"
user
="myuser"
/>
<
x:execute-sql
>
<
statement
connection
="conn3"
returnrows
="SearchResults/Listing"
>
<![CDATA[
select Listing.Status,Listing.MLSNbr,
Listing.ListAgent,
Listing.Address1,
Listing.ListPrice,
Listing.City,
ListingExtra.PropertyDesc,
ListingExtra.PropertyImage
from Listing, ListingExtra
where Listing.MLSNbr=ListingExtra.MLSNbr
and Status=1
and ListPrice > ?
and ListPrice < ?
and ( concat(',',?,',') like concat('%,',Area,',%') or Zip=?)
order by ListPrice
LIMIT ?
]]>
</
statement
>
<
param
binddir
="1"
ref
="Search/PriceMin"
type
="Varchar2"
/>
<
param
binddir
="1"
ref
="Search/PriceMax"
type
="Varchar2"
/>
<
param
binddir
="1"
ref
="Search/Area"
type
="Varchar2"
/>
<
param
binddir
="1"
ref
="Search/Zip"
type
="Varchar2"
/>
<
param
binddir
="1"
ref
="rows"
type
="Number"
/>
</
x:execute-sql
>
<
x:execute-xsl
>
<
xsl:stylesheet
version
="1.0"
xmlns:xsl
="
http://www.w3.org/1999/XSL/Transform
"
>
<
xsl:output
indent
="no"
method
="xml"
omit-xml-declaration
="yes"
/>
<
xsl:param
name
="object.id"
/>
<
xsl:template
match
="*"
>
<
table
style
="background-color:#ffffff;"
width
="97%"
>
<
tr
>
<
td
style
="color:#0000bb;font-size:12pt;font-weight:bold;text-align:right;border-top:1pt solid #0000bb;"
>
Patti Morgan Listings
</
td
>
</
tr
>
<
xsl:for-each
select
="/*/object[@id=$object.id]/Featured/Listing"
>
[. . .]
</
xsl:template
>
</
xsl:stylesheet
>
</
x:execute-xsl
>
|
| | |