Hi Sheen,

I think that "concat( Sale/BillID, 'SALE' )" is a perfectly valid _expression_ even if
"Sale/BillID" path doesn't exist in your document. This sounds like Xalan related. Maybe somebody from Xalan user list can help you better.



Please respond to xerces-j-user <[EMAIL PROTECTED]>

To:        xerces-j-user <[EMAIL PROTECTED]>
cc:        

Subject:        RE: XPath help please...

Hiran,

Thanks for your effort. But, my problem is slightly different. I need
to do the validation within my program. I'm looing for a way of
validating the whole _expression_ against a source document or extracting
the path strings from a given _expression_/function.

Regards,
Sheen



Hi, Sheen.

Your _expression_ "Sale/BillID" is always valid, but it maybe evaluates
to the
empty node set (no such node found). So all you have to do is to check
whether that is the case. You can do that using the boolean function
like it

<xsl:if test="boolean(Sale/BillID)">...</xsl:if>

See also http://www.w3.org/TR/xpath#function-boolean

Hiran

-----------------------------------------
Hiran Chaudhuri
SAG Systemhaus GmbH
Elsenheimerstra?e 11
80687 Munchen
Germany
[EMAIL PROTECTED]
Phone +49-89-54742-134
Fax   +49-6151-9234-5134

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Monday, December 03, 2001 5:45 PM
> To: [EMAIL PROTECTED]
> Subject: XPath help please...
>
>
>
>
> > ----------
> > Von:                  [EMAIL PROTECTED]:[EMAIL PROTECTED]
> > Gesendet:                  Montag, 3. Dezember 2001 17:44:59
> > An:                  [EMAIL PROTECTED]
> > Betreff:                  XPath help please...
> > Diese Nachricht wurde automatisch von einer Regel weitergeleitet.
> >
> Hi all,
>
> Please can you help me before I start getting into the complexities.
>
> If I have an _expression_ like
>
>                  concat( Sale/BillID, 'SALE' )
>
> where Sale/BillID is an element in the source XML document. If I
> evaluate/execute this _expression_ using XPathAPI I get String object,
> irrespective of whether the path is valid or not.
>
> Is there any way, in a given such _expression_, can I identify the path
> strings so that the validation of the path can be done separately? Or
> is there a way I can achieve this by using existing Xalan classes?
>
>
> Thanks,
> Sheen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to