Altova Mailing List Archives


Re: [xsl] XSL questions

From: "Wei Wei" <wei725@--------->
To:
Date: 6/1/2006 6:09:00 PM
Thanks Dave for your response. And please see below.

> > I have a element definited in a DTD file as <!ELEMENT Para
> > (#PCDATA | Emphasis)*>
> >
> > I need to the content of the element contains the html list tags,
> > eg. <ul><LI>first</LI><LI>second</LI></ul>.
> >
> > XMLSpy says that is invalid since the parent elements' content
> > disallow element ul.
>
> XMLSpy is correct to say that's invalid, the dtd says you may not have
> html elements there and you say you need them, so you need to ignore the
> dtd or to change the dtd. XSLT doesn't care, if you generate the html
> elements in a way that is not valid you get no warning from xslt.
>

I can use another editor to make the change. The problem is the html tags
don't serve its funcation when a html file is genereated with the XSL file.

Not a solution?


> > The position function doesn't work for my need. It returns the
> > total number of elements.
> No it doesn't, it returns the position of thee current node in the
> current node list.
>

You're right. But, that is not what I need. I need to know the number of
elements met the condition(both in the "when" and "otherwise"), but not the
position of an element in the list.


> > I have tried to use the count on an element/attribute. I don't know
> > why it always returns one.
>
> > ... count(@id)
>
> I'm not sure what value you'd expect it to return, @id selects all the
> id attributes of the current node, and there can only ever be at most 1
> attribute with the same name, so this will always be 1 (if there is an
> id) or 0 otherwise.
>

The id is an attribute of the node looping. I guess I should count the node
itself. But, the editor doesn't allow me.

> 		<xsl:for-each select=" ...">
> 					<xsl:if test="$current_id = @relatedPerson">
>
> 					</xsl:if>
> 				</xsl:for-each>
>
> don't do that, just select the nodes that you want
>
> 		<xsl:for-each select=" ...[$current_id = @relatedPerson]">
> 		</xsl:for-each>
>

That serves the same function. But, it is not what I am asking for. I need to
find out whether there is an element met the condition after the loop.


Thanks,

w.

> ________________________________________________________________________
> 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
> ________________________________________________________________________

>


--
_______________________________________________

Search for businesses by name, location, or phone number.  -Lycos Yellow
Pages

http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?
SRC=lycos10

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.