RE: [xsl] To Split, Pick/Select, Obtain and use Values from a single XHTML style ="..." attribute containing Bunched Formatting Attributes in it. style="TABLE-LAYOUT: fixed; WIDTH: 591px; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-

Subject: RE: [xsl] To Split, Pick/Select, Obtain and use Values from a single XHTML style ="..." attribute containing Bunched Formatting Attributes in it. style="TABLE-LAYOUT: fixed; WIDTH: 591px; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-
From: "SANWAL, ABHISHEK (HP-Houston)" <abhishek.sanwal@xxxxxx>
Date: Wed, 22 Sep 2004 20:32:50 -0500
Thank you Francesco.

I believe I went through the problem and now I think to make it simpler
I think I want to just split the "Style Attribute Collection" into
separate attributes.

Any suggestions on that?

I am wondering if someone already has written an XSL for that. If not I
will take it from here.

Thanks,

Abhishek
____________________________________________________________

Abhishek Sanwal
HP - Houston Campus

........................................................................
..................

-----Original Message-----
From: Francesco Barresi [mailto:kywocs@xxxxxxxxx]
Sent: Wednesday, September 22, 2004 8:05 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] To Split, Pick/Select, Obtain and use Values from a
single XHTML style ="..." attribute containing Bunched Formatting
Attributes in it. style="TABLE-LAYOUT: fixed; WIDTH: 591px;
BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-

Hi,

You could use something like this:

<xsl:template name="stripStyles">
<!-- the param $stringToStrip must be in this form:
$stringToStrip = "TABLE-LAYOUT: fixed;
WIDTH: 591px; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none;
BORDER-LEFT-STYLE: none; BORDER-COLLAPSE: collapse; WORD-WRAP:
break-word; BORDER-BOTTOM-STYLE: none"
 -->
 <xsl:param name="stringToStrip" select="''"/>
 <xsl:if test="$stringToStrip != ''">
	<xsl:variable name="subString"
select="substring-before($stringToStrip,';')"/>
	<style>
		<name>
			<xsl:value-of
select="substring-before($subString,':')"/>
		</name>
		<value>
			<xsl:value-of
select="substring-after($subString,':')"/>
		</value>
	</style>
	<xsl:call-template name="stripStyles">
	<xsl:with-param name="stringToStrip"
select="substring-after($stringToStrip,';')"/>
			</xsl:call-template>
 </xsl:if>
</xsl:template>

and the result of the template is this:

<style>
	<name>TABLE-LAYOUT</name>
	<value> fixed</value>
</style>
<style>
	<name> WIDTH</name>
	<value> 591px</value>
</style>
<style>
	<name> BORDER-TOP-STYLE</name>
	<value> none</value>
</style>
<style>
	<name> BORDER-RIGHT-STYLE</name>
	<value> none</value>
</style>
<style>
	<name> BORDER-LEFT-STYLE</name>
	<value> none</value>
</style>
<style>
	<name> BORDER-COLLAPSE</name>
	<value> collapse</value>
</style>
<style>
	<name> WORD-WRAP</name>
	<value> break-word</value>
</style>
<style>
	<name></name>
	<value></value>
</style>

It isn't the state-of-the-art, just look at the empty <style> added at
the end, and it could use less variables, but this is just an example
so it can be a start.
I hope I helped.
Bye
Francesco.

On Wed, 22 Sep 2004 19:15:49 -0500, SANWAL, ABHISHEK (HP-Houston)
<abhishek.sanwal@xxxxxx> wrote:
> <table class="MsoNormalTable msoUcTable" style="TABLE-LAYOUT: fixed;
> WIDTH: 591px; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none;
> BORDER-LEFT-STYLE: none; BORDER-COLLAPSE: collapse; WORD-WRAP:
> break-word; BORDER-BOTTOM-STYLE: none" tabIndex="-1" cellPadding="0"
> border="1">
>
> How would I write an XSL module to pick up and split up the single
> attribute style="...." and obtain the "named" ATTRIBUTES that have
been
> bunched inside this X-HTML produced by InfoPath?
>
> An xsl that allowed me to obtain them by "NAME" would be great.
>
> An xsl that went through the entire thing and extracted and mapped
> attributes that I have pre-defined in a match list would be even
better
> :).
>
> Kindly advise oh gods of recursive xsl attribute tokenizers :).
>
> I am having a tough time trying to figure out the best way to do this
> efficiently. I know that it could involve use of substring() matches.
>
> I don't know, maybe some ideas or code might give me some direction.
>
> Thanks,
>
> Abhishek
> ____________________________________________________________
>
> Abhishek Sanwal
> HP - Houston Campus
>
>



--
www.GetFirefox.com !!

Current Thread