Re: [xsl] Accessing node from different xml..

Subject: Re: [xsl] Accessing node from different xml..
From: Arulraj <p_arulraj@xxxxxxxxx>
Date: Thu, 25 Nov 2004 00:22:02 -0800 (PST)
Hello David,

sorry for the wrong typing..
following is one sample

<?xml version="1.0" encoding="UTF-8"?>
<AnnotationData version="1.0">
<Rot angle="90">
<PElems>
<H
pID="C94BD93562BD7EFDB3D96A01346FF83A0409031036150001"
 block="true"/>
</PElems>
</Rot>

In some cases I get <Rot angle="90"> in that XML file,
In some other cases i wont receive <Rot angle="90">
I can receive the XML in following format.
<?xml version="1.0" encoding="UTF-8"?>
<AnnotationData version="1.0">
<PElems>
<H
pID="C94BD93562BD7EFDB3D96A01346FF83A0409031036150001"
 block="true"/>
</PElems>

So, I got a problem in Accessing <H>
by following way
select="$StampTextInfo/AnnotationData/Rot/PElems/H[@pID=$TiffIdTmp]"/>

I have solved this.. by checking <Rot> 
if it is exists 
I will use
select="$StampTextInfo/AnnotationData/Rot/PElems/H[@pID=$TiffIdTmp]"/>
or 
select="$StampTextInfo/AnnotationData/PElems/H[@pID=$TiffIdTmp]"/>

regards,
Arul
--- David Carlisle <davidc@xxxxxxxxx> wrote:

> 
>   <?xml version="1.0" encoding="UTF-8"?>
>   <AnnotationData version="1.0">
>   <Rot angle="90" pN="0">
>   <PElems>
>   <H
>  
>
pID="C94BD93562BD7EFDB3D96A01346FF83A0409031036150001"
>   />
>   </Rot>
>  
> 
> That is not well formed: it is missing a < at the
> start of the xml
> declaration and the element PElems is not closed
> anywhere.
> 
> Presumably your input doesn't really look like that.
> 
>   So, I am using following way to access that <H>
>   <xsl:apply-templates
>  
>
select="$StampTextInfo/AnnotationData/Rot/PElems/H[@pID=$TiffIdTmp]"/>
> 
> 
> That looks correct assuming that PElems in your
> input is closed inside
> the Rot element. Whether or not any element is
> selected of course
> depends on whether $TiffIdTmp is equal to
> C94BD93562BD7EFDB3D96A01346FF83A0409031036150001
> and you don't show the definition of that variable.
> 
>   I got a problem, In some case I dont get <Rot>
> element
>   in the second xml file is dynamic one.
> 
> I can't understand this sentence. What do you mean
> by "dynamic" here?
> 
> David
> 
>
________________________________________________________________________
> This e-mail has been scanned for all viruses by
> Star. The
> service is powered by MessageLabs. For more
> information on a proactive
> anti-virus service working around the clock, around
> the globe, visit:
> http://www.star.net.uk
>
________________________________________________________________________
> 
> 



	
		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail

Current Thread