You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Thomas Winkler <th...@yahoo.de> on 2005/10/13 17:33:13 UTC

marking some elements by same @id

Hello,

I am designing a table with the trunk version of FOP.
The table must be configurable.


For example : it depends on the order if the
"Position" should appear or not.

So I created a xsl-fo stylesheet like this :


<fo:table ...>
<fo:table-column column-width="1.5cm"/>
<fo:table-column id="pos" column-width="2cm"/>
<fo:table-column column-width="2cm"/>

<fo:table-header>
<fo:table-row>

<fo:table-cell border-bottom="solid">
<fo:block>
Artikel
</fo:block>
</fo:table-cell>

<fo:table-cell id="pos"  border-bottom="solid">
<fo:block>
Position
</fo:block>
</fo:table-cell>

<fo:table-cell border-bottom="solid">		<fo:block>
Datum
</fo:block>
</fo:table-cell>

</fo:table-row>
</fo:table-header>

<fo:table-body>

<xsl:for-each select="Order">
<fo:table-row>

<fo:table-cell border-bottom="dotted">
<fo:block>
<xsl:value-of select="@name"/>
</fo:block>
</fo:table-cell>

<fo:table-cell id="Pos" border-bottom="dotted">
<fo:block>
<xsl:value-of select="@PosName"/>
</fo:block>
</fo:table-cell>
<fo:table-cell border-bottom="dotted">
<fo:block>
<xsl:value-of select="@date"/>
</fo:block>
</fo:table-cell>
...


If I want to remove the "Position", then the following
template did that for me :

<xsl:template match="//*[@id='Pos']"/>

Luckily, Xalan does not complain about the non-unique
values of id.

However; if I want the "Position" in the table then
FOP will correctly complain "... id values must be
unique in document."

My question : is there any possibility to mark several
elements with the same attribute name so that I can
run such a "remove-template" ?

Or : how can I turn off the unique-id checking of FOP
? 


Thanks in advance !


Thomas





 






	

	
		
___________________________________________________________ 
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: marking some elements by same @id

Posted by Glen Mazza <gm...@apache.org>.
Andreas L Delmelle wrote:

> 
> (Jay's suggestion just rolled in --I'm not 100% sure, but I think FOP 
> will complain if it encounters attributes in the fo: namespace that are 
> not properties as defined in the Rec. FOP 0.20.5 may turn out to be 
> forgiving... Just to be on the safe side, I'd use a separate namespace.)
> 

Looking at the Rec to determine this, I found two possible problems with 
the current way that the rules are written, and have submitted them to 
the XSL-Editors ML for the working group to look over.[1]

Glen

[1] http://lists.w3.org/Archives/Public/xsl-editors/2005OctDec/

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: marking some elements by same @id

Posted by JB...@s-s-t.com.
(Jay's suggestion just rolled in --I'm not 100% sure, but I think FOP 
will complain if it encounters attributes in the fo: namespace that are 
not properties as defined in the Rec. FOP 0.20.5 may turn out to be 
forgiving... Just to be on the safe side, I'd use a separate 
namespace.)

---------------------------------------------------------------------

I hadn't thought of that because I always do all my processing against 
some other XML dialect and generate FO as the last step. A separate 
namespace would be the way to go, for sure.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: marking some elements by same @id

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Oct 13, 2005, at 17:33, Thomas Winkler wrote:

Hi,

> <snip />
> If I want to remove the "Position", then the following
> template did that for me :
>
> <xsl:template match="//*[@id='Pos']"/>
>
> Luckily, Xalan does not complain about the non-unique
> values of id.
>
> However; if I want the "Position" in the table then
> FOP will correctly complain "... id values must be
> unique in document."
>
> My question : is there any possibility to mark several
> elements with the same attribute name so that I can
> run such a "remove-template" ?

How about using 'id=posXXX', where the XXX value is the result from 
generate-id()?
In that case, you could have a template similar to what you have now:

<xsl:template match="//*[starts-with(@id,'pos')]" />

Another option would be to introduce a custom namespace for that, and 
define the 'id' attribute in that namespace, so the unique-constraint 
won't apply (since it's no longer the default XML 'id' attribute).

(Jay's suggestion just rolled in --I'm not 100% sure, but I think FOP 
will complain if it encounters attributes in the fo: namespace that are 
not properties as defined in the Rec. FOP 0.20.5 may turn out to be 
forgiving... Just to be on the safe side, I'd use a separate 
namespace.)

HTH!

Greetz,

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: marking some elements by same @id

Posted by JB...@s-s-t.com.
The fix for this is to not use "id". You should use an attribute named 
"id" only when you plan to assign a unique identifier to that attribute. 
Otherwise, lots of XML- and XSL-based systems (including but certainly not 
limited to FOP) will break. So, use some other name instead: "myid", 
"groupid", "tableid", "Oscar", whatever.

Jay Bryant
Bryant Communication Systems
(presently consulting at Synergistic Solution Technologies)




Thomas Winkler <th...@yahoo.de> 
10/13/2005 10:33 AM
Please respond to
fop-users@xmlgraphics.apache.org


To
fop-users@xmlgraphics.apache.org
cc

Subject
marking some elements by same @id






Hello,

I am designing a table with the trunk version of FOP.
The table must be configurable.


For example : it depends on the order if the
"Position" should appear or not.

So I created a xsl-fo stylesheet like this :


<fo:table ...>
<fo:table-column column-width="1.5cm"/>
<fo:table-column id="pos" column-width="2cm"/>
<fo:table-column column-width="2cm"/>

<fo:table-header>
<fo:table-row>

<fo:table-cell border-bottom="solid">
<fo:block>
Artikel
</fo:block>
</fo:table-cell>

<fo:table-cell id="pos"  border-bottom="solid">
<fo:block>
Position
</fo:block>
</fo:table-cell>

<fo:table-cell border-bottom="solid"> <fo:block>
Datum
</fo:block>
</fo:table-cell>

</fo:table-row>
</fo:table-header>

<fo:table-body>

<xsl:for-each select="Order">
<fo:table-row>

<fo:table-cell border-bottom="dotted">
<fo:block>
<xsl:value-of select="@name"/>
</fo:block>
</fo:table-cell>

<fo:table-cell id="Pos" border-bottom="dotted">
<fo:block>
<xsl:value-of select="@PosName"/>
</fo:block>
</fo:table-cell>
<fo:table-cell border-bottom="dotted">
<fo:block>
<xsl:value-of select="@date"/>
</fo:block>
</fo:table-cell>
...


If I want to remove the "Position", then the following
template did that for me :

<xsl:template match="//*[@id='Pos']"/>

Luckily, Xalan does not complain about the non-unique
values of id.

However; if I want the "Position" in the table then
FOP will correctly complain "... id values must be
unique in document."

My question : is there any possibility to mark several
elements with the same attribute name so that I can
run such a "remove-template" ?

Or : how can I turn off the unique-id checking of FOP
? 


Thanks in advance !


Thomas





 






 

 
 
___________________________________________________________ 
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier 
anmelden: http://mail.yahoo.de

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org