Subjects
Home
Xalan extension functions
Fomatting question serializing DOM with pretty print
xalan with pull parser
Cannot find the declaration
Apache Xalan drop support to run on JRE 1 1 x
Why does Doctype change processing of a document
Node set to XML string via Java extensions in Xalan J: possible?
Templates/Transformers + thread safety???
Problem evaluating xpath with muliple prefix with different namespace
remove an arbitrary attribute from xsl output
Xalan3 XSLT 2 0 XPath 2 0 support?
Problem using compiled translets with Xalan !!
Xalan and jstl 1 1 problem with transform tag
NullPointer in DOM2DTM getLocalName
URIResolvers base parameter with xsltc and cascaded imports
Performance problem for Xalan J on intel dual core
Standard libraries in JAXP?
Serializing a DOM tree to XML file, customize entities replacement
Library Conflict Involving BCEL Library
A question on how users are using <xsl:message >
Kevin Cormier as a new Apache Xalan J committer
Struggling to iterate over tokenized string
Xalan count() trouble
Problem with recursive xpath
Error when switching to java 1 5
document( ' ')
Problem with Xalan2 7 0 transformation
cr/lf options
entity encoded XML
can xalan transform 2 xml using one xslt?
Xalan J JIRA defect review Monday October 16, 2006 from 2:00 to 3:30 pm ED
xsl transform with cdata section elements
xslt parameters not expanded
Weird behavior of XPath evaluate()
How to avoid <xsl:message > instruction prints stylesheet file informations ?
Cannot find SimpleTransform subdirectory after installing Xalan J
recover from document not found exceptions
jdk1 5 and Xalan jar differences?
Performance Issue
Error/Bug adding floating point numbers
XPathAPI: eval exp using nodes with default namespace
modifying xalan to output invalid XML
NullPointerException
mege two separate xml nodes into one
Is this a XALAN document identification bug?
is StylesheetRoot really java io Serializable ?
transform() fails for DOMSource but succeeds for StreamSource
Thoughts on Transformer parameter passing
HELP, Xalan and jstl 1 1 problem with transformer
Problem with XPath namespace axis?
string utils:replace deleting search string if replacement string is an HTML
help with enumeration values pls
xalan 2 5 1 vs 2 7 performance question
How to insert/update in XML document
HTML Serialization and Handling of Ampersands in HREF Attributes
XHTML link tag stripping
SystemId Unknown; Line #24; Column #49; java lang NullPointerException
xpath text() help
Apostrophe problem with xalan 2 7 0
How to set variables in XML document?
Links
Home
Oracle database error code ...
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Using java extension with code

Using java extension with code

2003-02-19       - By Voytenko, Dimitry
Reply:     1     2  

Hi Olivier,

Where do you have the Xalan library installed? Did you try this
http://xml.apache.org/xalan-j/faq.html#faq-N1039A?

Thanks,
Dimitry

-----Original Message-----
From: Olivier LAMY [mailto:LAMY_Olivier@(protected)]
Sent: Wednesday, February 19, 2003 10:17
To: Xalan J Users
Subject: Using java extension with code


I send you the xml :

<OTA_HotelAvailRQ LanguageId="fr" Version="2001B"
xmlns="http://www.opentravel.org/OTA"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opentravel.org/OTA
http://57.200.123.192:8090/OTAebServer/schemas/2001B/OTA_HotelAvailRQ.xsd"><
BookingSegments><BookingSegment><HotelReference
HotelCode="1099"/><StayDateRange EndDate="2003-03-27T19:02:31"
StartDate="2003-03-26T19:02:31"/><RatePlanCandidates><RatePlanCandidate
RatePlanCode=""/></RatePlanCandidates><RoomStayCandidates><RoomStayCandidate
RoomTypeCode=""><GuestCount
Count=""/></RoomStayCandidate></RoomStayCandidates></BookingSegment></Bookin
gSegments></OTA_HotelAvailRQ>


the xsl :

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:ota="http://www.opentravel.org/OTA"
xmlns:java="http://xml.apache.org/xalan/java"
exclude-result-prefixes="ota java">
<xsl:output method="xml" encoding="ISO-8859-1"/>
<!-- init des param�tres -->
<!--<xsl:param name="TCfonction"/>-->
<xsl:param name="codecro"/>
<xsl:param name="codesubcro"/>
<!-- include xsl utilitaire -->
<!--<xsl:include href="util.xsl" />-->

<xsl:template match="ota:OTA_HotelAvailRQ">
<accortronccommun mode="input" version="1.00">
<fonction nom="eDispochbR5SNMI">
<parametre nom="codecro"><xsl:value-of select="$codecro" /></parametre>
<parametre nom="codesubcro"><xsl:value-of select="$codesubcro"
/></parametre>
<xsl:apply-templates select="//ota:StayDateRange" />
<!--
<parametre nom="datedeb">
<xsl:value-of select="//StayDateRange/@(protected)" />
<xsl:call-template name="return_date">
<xsl:with-param name="date">
</xsl:with-param>
</xsl:call-template>
</parametre>
<parametre nom="datefin">
<xsl:value-of select="//StayDateRange/@(protected)" />
<xsl:call-template name="return_date">
<xsl:with-param name="date">
</xsl:with-param>
</xsl:call-template>
</parametre>
-->
<!-- recherche du codehotel -->
<parametre nom="codehotel">
<xsl:value-of select="//ota:HotelReference/@(protected)" />
</parametre>
<!-- recherche du codeproduit -->
<parametre nom="codeproduit">
<xsl:value-of select="//RoomStayCandidates/RoomStayCandidate/@(protected)"
/>
</parametre>
<!-- recherche du rateaccess -->
<parametre nom="listdata">
<xsl:value-of select="//RatePlanCandidates/RatePlanCandidate/@(protected)"
/>
</parametre>
<parametre nom="typedata">0</parametre>
<parametre nom="nbpax">
<xsl:value-of
select="//RoomStayCandidates/RoomStayCandidate/GuestCount/@(protected)" />
</parametre>
<parametre nom="codelangue">
<xsl:value-of select="//@(protected)" />
</parametre>
</fonction>
</accortronccommun>
</xsl:template>
<xsl:template match="ota:StayDateRange">
<xsl:variable name="datedeb"
select="java:com.accor.util.Tools.transformISODateToTcDate(string(@(protected)
))" />
<xsl:variable name="datefin"
select="java:com.accor.util.Tools.transformISODateToTcDate(string(@(protected)))
" />
<parametre nom="datedeb">
<xsl:value-of select="$datedeb" />
</parametre>
<parametre nom="datefin">
<xsl:value-of select="$datefin" />
</parametre>

</xsl:template>
</xsl:stylesheet>

The static method :

public static String transformISODateToTcDate(String DatetoTransform) {
try {
SimpleDateFormat DF = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss",
Locale.US);
Date DT = DF.parse(DatetoTransform);
return new SimpleDateFormat("dd MMM yy", Locale.US).format(DT);
} catch (Exception e) {
logger.error("erreur sur parsing de la date", e);
return new String("");
}
}

The xalan Trace :

null Line #0, Column #0: template match='/'
null Line #0, Column #0: apply-templates
Selected source node '#document'
(default root rule) apply-templates, select='null':
    10001: OTA_HotelAvailRQ
null Line #0, Column #0: template match='*'
null Line #0, Column #0: apply-templates
Selected source node 'OTA_HotelAvailRQ'
(default rule) apply-templates, select='null':
    10008: BookingSegments
null Line #0, Column #0: template match='*'
null Line #0, Column #0: apply-templates
Selected source node 'BookingSegments'
(default rule) apply-templates, select='null':
    10009: BookingSegment
null Line #0, Column #0: template match='*'
null Line #0, Column #0: apply-templates
Selected source node 'BookingSegment'
(default rule) apply-templates, select='null':
    1000a: HotelReference
    1000c: StayDateRange
    1000f: RatePlanCandidates
    10012: RoomStayCandidates
null Line #0, Column #0: template match='*'
null Line #0, Column #0: apply-templates
Selected source node 'HotelReference'
(default rule) apply-templates, select='null':
    [empty node list]
null Line #0, Column #0: template match='*'
null Line #0, Column #0: apply-templates
Selected source node 'StayDateRange'
(default rule) apply-templates, select='null':
    [empty node list]
null Line #0, Column #0: template match='*'
null Line #0, Column #0: apply-templates
Selected source node 'RatePlanCandidates'
(default rule) apply-templates, select='null':
    10010: RatePlanCandidate
null Line #0, Column #0: template match='*'
null Line #0, Column #0: apply-templates
Selected source node 'RatePlanCandidate'
(default rule) apply-templates, select='null':
    [empty node list]
null Line #0, Column #0: template match='*'
null Line #0, Column #0: apply-templates
Selected source node 'RoomStayCandidates'
(default rule) apply-templates, select='null':
    10013: RoomStayCandidate
null Line #0, Column #0: template match='*'
null Line #0, Column #0: apply-templates
Selected source node 'RoomStayCandidate'
(default rule) apply-templates, select='null':
    10015: GuestCount
null Line #0, Column #0: template match='*'
null Line #0, Column #0: apply-templates
Selected source node 'GuestCount'
(default rule) apply-templates, select='null':
    [empty node list]
STARTDOCUMENT
ENDDOCUMENT

Thanks a lot to help me,
Olivier


**********************************************************************
Ce message �lectronique et tous les fichiers joints ainsi que  les
information contenues dans ce message ( ci apr�s "le message" ), sont
confidentiels et destin�s exclusivement � l'usage de la  personne � laquelle
ils sont adress�s. Si vous avez re�u ce message par erreur, merci  de le
renvoyer � son �metteur et de le d�truire. Toute diffusion, publication,
totale ou partielle ou divulgation sous quelque forme que se soit non
express�ment autoris�es de ce message, sont interdites.
**********************************************************************
This e-mail, any attachements and the information contained (herein " the
message" ) are confidentiel and intended solely for the use of the
addressee(s) if you have received this message in error please send it back
to the sender and delete it. Unauthorized publication, use, dissemination or
disclosure, either whole or partial, of this  message is stictly prohibited
**********************************************************************


_____________________________________________________
Sector Data, LLC, is not affiliated with Sector, Inc., or SIAC