[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Attempt to Select from the Top of Document No Work

Subject: RE: Attempt to Select from the Top of Document No Worky
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Mon, 8 Dec 2003 22:36:12 -0000
select from
Nothing wrong with the code that I can see. Perhaps it's something to do
with namespaces. Cut it down to a small example that shows the problem,
and then show us the full XML and XSL.

Incidentally, your code:

>     <xsl:for-each 
> select="//textStyle[@name=$styleName]/inlineAttr/@*">
> 	<xsl:attribute name="{local-name(.)}">
> 	<xsl:value-of select="."/>
> 	</xsl:attribute>
>     </xsl:for-each>

is equivalent to 

<xsl:copy-of select="//textStyle[@name=$styleName]/inlineAttr/@*"/>

unless you are doing something very odd with namespaces.

Michael Kay


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Kyle Partridge
> Sent: 08 December 2003 21:07
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Attempt to Select from the Top of Document No Worky
> 
> 
> Hi,
> 
> I've searched high and low for the answer to this
> problem...to no avail...so I'll be quick.  I've got a
> pretty complicated xml document...lots of nodes.
> 
> I'm matching a paragraph, and I want to style it.  the 
> structure is something like:
> 
> <p style="blah">stuff in here</p>
> 
> Someplace else, far above, the "blah" style is
> defined, in a node pretty well nested:
> 
> <presentationSettings>
>  <textRendering>
>   <textStyles>
>    <textStyle name="Normal">
>     <blockAttr indent-left="0" indent-right="0"
> text-indent="0" text-align="left"
> list-style-type="none" tabs="0.5 1.0 1.2"/>
>     <inlineAttr font-family="Arial" font-size="10" 
> font-weight="normal" font-style="normal" 
> font-charset="Western" text-decoration="none" 
> vertical-align="baseline" color="#000"/>
>    </textStyle>
>    ...lots and lots more stuff before the preceeding
> tags close...
> 
> I tried to use this template to get the style
> information to apply to each paragraph, but it doesn't
> work.
> 
> <xsl:template match="ws:p">
>   <xsl:element name="fo:block">
>     <xsl:variable name="styleName" select="@style"/>
>     <xsl:for-each 
> select="//textStyle[@name=$styleName]/inlineAttr/@*">
> 	<xsl:attribute name="{local-name(.)}">
> 	<xsl:value-of select="."/>
> 	</xsl:attribute>
>     </xsl:for-each>
>     <xsl:apply-templates/>
>   </xsl:element>
> </xsl:template>
> 
> Maybe the reason is that // doesn't work inside of my
> existing query (ws:p), but what can I do to get the
> values I'm looking for?
> 
> Many thanks,
> KP
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
> http://companion.yahoo.com/
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.