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 Abhijit Junnare <ma...@yahoo.com> on 2003/10/03 20:38:44 UTC

Converting to uppercaseusing text-transform

Hi,
I am using the text-transform property to convert some
content to uppercase if an attribute has a specif
value. I tried using font-variant="small-caps" but it
doesnt give me the desired results. 
I looked through the FOP documentation and it says
that the text-transform property is NOT yet
implemented in FOP. I am wondering if there is any
chance that this will be implemented in FOP and if yes
how long would it take.
I tried writing a template to convert to capital
letters but it doesnt work the way I need coz I am
setting the attribute in the parent and I need its
children to inherit it irrespective of the level of
depth. Hence I cant pass a specific string to the
conversion template. 
If anyone has suggestion then will really appreciate
them.
Thanks,
Abhi

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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


RE: Indenting of list-block

Posted by Abhijit Junnare <ma...@yahoo.com>.
OK. I changed margin-left to start-indent. Still the
problem persists. The section inside the section is
indented by 12pt but the list items are indented by
12pt instead of 12+12=24pt. Any clues what is
happening.
Thanks,
Abhi
--- "Andreas L. Delmelle" <a_...@pandora.be>
wrote:
> > -----Original Message-----
> > From: Abhijit Junnare [mailto:mavlaabhi@yahoo.com]
> > 
> > hello,
> > I am using list-block. 
> 
> <snip/>
> 
> > 
> > I have set "margin-left=12pt" for section inside a
> 
> <snip/>
> 
> Abhi,
> 
> Sorry. 'margin-left' only implemented WRT pages &
> regions...
> 
> Greetz,
> 
> Andreas
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> fop-user-help@xml.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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


RE: Indenting of list-block

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Abhijit Junnare [mailto:mavlaabhi@yahoo.com]
> 
> hello,
> I am using list-block. 

<snip/>

> 
> I have set "margin-left=12pt" for section inside a

<snip/>

Abhi,

Sorry. 'margin-left' only implemented WRT pages & regions...

Greetz,

Andreas

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


Indenting of list-block

Posted by Abhijit Junnare <ma...@yahoo.com>.
hello,
I am using list-block. 
The structure of my XML is something like this

<Section>Title
 <Section>Title
  <List>
   <ListItem>zzzz</ListItem>
   <ListItem>zzzz</ListItem>
   <ListItem>zzzz</ListItem>
   <ListItem> 
    <List>
     <ListItem>zzzz</ListItem>
     <ListItem>zzzz</ListItem>
    </List>
   </ListItem>
   <ListItem>zzzz</ListItem>
   <ListItem>zzzz</ListItem>
  </List>
 </Section>
<Section>

I have set "margin-left=12pt" for section inside a
section. And the start-indent for list-item-block to
be 12points. Since the list-block is a child element
of the <fo:block> elemet used for section inside a
section I expect the list to be indented 12pt relative
to the block for section thus total indenting should
be 24pt. But it doesn't seem to be working that way.
I am wondering if the list-block element is any
different from regular <fo:block> elements. I use Epic
with the same stylesheet and it formats it with
correct indenting (24pt) so wondering if FOP treats
this somewhat different or I am getting something
wrong. 
Thanking you in anticipation.
Regards,
Abhi
  
     

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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


Re: Converting to uppercaseusing text-transform

Posted by Abhijit Junnare <ma...@yahoo.com>.
Thanks much. I have written something similar to this
and seems to be working as of now. Appreciate your
help.
Abhi

--- "J.Pietschmann" <j3...@yahoo.de> wrote:
> Abhijit Junnare wrote:
> > So I want to translate all the content that comes
> > under the <A Caps="Yes"> element to uppercase
> meaning
> > including its children elements <B> <C> and <D>
> 
> Using parameter:
>    <xsl:template match="A[@Caps='Yes']">
>      <xsl:apply-templates>
>        <xsl:with-param name="Caps" select="Yes"/>
>      </xsl:apply-templates>
>    </xsl:template>
> 
>    <xsl:template match="B|C|D">
>      <xsl:param name="Caps"/>
>      <xsl:apply-templates>
>        <xsl:with-param name="Caps" select="$Caps"/>
>      </xsl:apply-templates>
>    </xsl:template>
> 
>    <xsl:template match="text()">
>      <xsl:param name="Caps"/>
>      <xsl:choose>
>        <xsl:when test="$Caps='Yes'">
>          <xsl:value-of
> select="translate(.,$lower,$upper)"/>
>        </xsl:when>
>        <xsl:otherwise>
>          <xsl:value-of select="."/>
>        </xsl:otherwise>
>      </xsl:choose>
>    </xsl:template>
> 
> Beware: untested.
> 
> J.Pietschmann
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> fop-user-help@xml.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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


Re: Converting to uppercaseusing text-transform

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Abhijit Junnare wrote:
> So I want to translate all the content that comes
> under the <A Caps="Yes"> element to uppercase meaning
> including its children elements <B> <C> and <D>

Using parameter:
   <xsl:template match="A[@Caps='Yes']">
     <xsl:apply-templates>
       <xsl:with-param name="Caps" select="Yes"/>
     </xsl:apply-templates>
   </xsl:template>

   <xsl:template match="B|C|D">
     <xsl:param name="Caps"/>
     <xsl:apply-templates>
       <xsl:with-param name="Caps" select="$Caps"/>
     </xsl:apply-templates>
   </xsl:template>

   <xsl:template match="text()">
     <xsl:param name="Caps"/>
     <xsl:choose>
       <xsl:when test="$Caps='Yes'">
         <xsl:value-of select="translate(.,$lower,$upper)"/>
       </xsl:when>
       <xsl:otherwise>
         <xsl:value-of select="."/>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>

Beware: untested.

J.Pietschmann


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


Re: Converting to uppercaseusing text-transform

Posted by Abhijit Junnare <ma...@yahoo.com>.
Thanks for the help. 
could you please explain me how can i use mode or
parameters as u said for converting to small caps. for
example if i have an XML like this
<Main>
<element 1>....
</elemen 1>
<element 1>
...
<element 2>
<A>..</A>
</element 2>
</element 1>
<element 1>
<A
Caps="Yes">.....<B>.....<C>....</C></B><D>...<D>....</A>
<D>....</>
<element 1>
</Main>

So I want to translate all the content that comes
under the <A Caps="Yes"> element to uppercase meaning
including its children elements <B> <C> and <D>
Your help is really appreciated.
Thanks,
Abhi

--- "J.Pietschmann" <j3...@yahoo.de> wrote:
> Abhijit Junnare wrote:
> > I looked through the FOP documentation and it says
> > that the text-transform property is NOT yet
> > implemented in FOP. I am wondering if there is any
> > chance that this will be implemented in FOP and if
> yes
> > how long would it take.
> 
> The spec itself recommends against using this
> feature. Uppercasing
> arbitrary Unicode letters is a quite non-trivial
> task.
> 
> > I tried writing a template to convert to capital
> > letters but it doesnt work the way I need coz I am
> > setting the attribute in the parent and I need its
> > children to inherit it irrespective of the level
> of
> > depth. Hence I cant pass a specific string to the
> > conversion template. 
> 
> Ouch! Pass a mode or a parameter to templates
> applying to
> the child element, and do a
> translate(.,$lower,$upper)
> in th ecorrespondinggly moded template matching
> text(),
> or if the text() template senses the parameter.
> 
> J.Pietschmann
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> fop-user-help@xml.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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


RE: Converting to uppercaseusing text-transform

Posted by Victor Mote <vi...@outfitr.com>.
J.Pietschmann wrote:

> Abhijit Junnare wrote:
> > I looked through the FOP documentation and it says
> > that the text-transform property is NOT yet
> > implemented in FOP. I am wondering if there is any
> > chance that this will be implemented in FOP and if yes
> > how long would it take.
>
> The spec itself recommends against using this feature. Uppercasing
> arbitrary Unicode letters is a quite non-trivial task.

There are some use cases where it is very helpful to have this feature
(titles of books and chapters for example). It has been implemented in the
trunk, a bit klunkily and needing work, but the basics should work. I would
be glad for people to use it and test it and let us know of exceptions to
the structure that is there.

Victor Mote


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


Re: Converting to uppercaseusing text-transform

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Abhijit Junnare wrote:
> I looked through the FOP documentation and it says
> that the text-transform property is NOT yet
> implemented in FOP. I am wondering if there is any
> chance that this will be implemented in FOP and if yes
> how long would it take.

The spec itself recommends against using this feature. Uppercasing
arbitrary Unicode letters is a quite non-trivial task.

> I tried writing a template to convert to capital
> letters but it doesnt work the way I need coz I am
> setting the attribute in the parent and I need its
> children to inherit it irrespective of the level of
> depth. Hence I cant pass a specific string to the
> conversion template. 

Ouch! Pass a mode or a parameter to templates applying to
the child element, and do a translate(.,$lower,$upper)
in th ecorrespondinggly moded template matching text(),
or if the text() template senses the parameter.

J.Pietschmann


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


RE: Converting to uppercaseusing text-transform

Posted by Victor Mote <vi...@outfitr.com>.
Clay Leeds wrote:

> According to the FOP Compliance page (watch wrap):
>
> http://xml.apache.org/fop/compliance.html#fo-property-text-transform
>
> There is "basic" support for text-transform, but "extended" support is
> not available. I clicked on the "§7.16.6" link:

Nope, that is not what that means. The basic and extended columns refer to
the spec itself, which has three levels of conformance. The "no" means that
FOP does not support it. The blue in column 1 means that FOP is conformant
with the spec on this issue for the spec's basic support. In other words,
FOP passes a conformance test for basic XSL-FO support WRT text-transform,
but only because support for text-transform is not required for basic XSL-FO
support.

Victor Mote


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


Re: Converting to uppercaseusing text-transform

Posted by Abhijit Junnare <ma...@yahoo.com>.
Below is the output I get on the screen.
As you can see it says not yet implemented. I believe
I am using the latest version. Do let me know if I am
doing something wrong.
Thanks,
Abhi

C:\Abhi\fop-0.20.5>fop -c lib\conf\userconfig.xml -xml
xml\CancellationNotice.xm
l -xsl xml\ExpereStandard_New.xsl -pdf
xml\CancellationNotice1.pdf
[INFO] Using org.apache.xerces.parsers.SAXParser as
SAX2 Parser
[INFO] Using org.apache.xerces.parsers.SAXParser as
SAX2 Parser
[INFO] FOP 0.20.5
[INFO] Using org.apache.xerces.parsers.SAXParser as
SAX2 Parser
[INFO] building formatting object tree
[INFO] setting up fonts
[ERROR] property - "text-transform" is not implemented
yet.
[ERROR] property - "text-transform" is not implemented
yet.
[ERROR] property - "text-transform" is not implemented
yet.
[ERROR] property - "text-transform" is not implemented
yet.
[ERROR] property - "text-transform" is not implemented
yet.
[INFO] [1]
[INFO] Using org.apache.xerces.parsers.SAXParser as
SAX2 Parser
[INFO] Using org.apache.xerces.parsers.SAXParser as
SAX2 Parser
[ERROR] At least one of minimum, optimum, or maximum
IPD must be specified on ta
ble.
[INFO] Using org.apache.xerces.parsers.SAXParser as
SAX2 Parser
[INFO] Using org.apache.xerces.parsers.SAXParser as
SAX2 Parser
[ERROR] At least one of minimum, optimum, or maximum
IPD must be specified on ta
ble.
[INFO] Using org.apache.xerces.parsers.SAXParser as
SAX2 Parser
[INFO] area contents overflows area in line
[INFO] Using org.apache.xerces.parsers.SAXParser as
SAX2 Parser
[INFO] area contents overflows area in line
[INFO] area contents overflows area in line
[INFO] area contents overflows area in line
[INFO] area contents overflows area in line
[INFO] area contents overflows area in line
[INFO] area contents overflows area in line
[INFO] area contents overflows area in line
[INFO] area contents overflows area in line
[INFO] area contents overflows area in line
[INFO] [2]
[INFO] area contents overflows area in line
[INFO] area contents overflows area in line
[INFO] area contents overflows area in line
[INFO] Using org.apache.xerces.parsers.SAXParser as
SAX2 Parser
[INFO] [3]
[WARNING] table-layout=auto is not supported, using
fixed!
[ERROR] At least one of minimum, optimum, or maximum
IPD must be specified on ta
ble.
[INFO] Parsing of document complete, stopping renderer



--- Clay Leeds <cl...@medata.com> wrote:
> Abhijit Junnare wrote:
> > Hi,
> > I am using the text-transform property to convert
> some
> > content to uppercase if an attribute has a specif
> > value. I tried using font-variant="small-caps" but
> it
> > doesnt give me the desired results. 
> > I looked through the FOP documentation and it says
> > that the text-transform property is NOT yet
> > implemented in FOP. I am wondering if there is any
> > chance that this will be implemented in FOP and if
> yes
> > how long would it take.
> 
> According to the FOP Compliance page (watch wrap):
> 
>
http://xml.apache.org/fop/compliance.html#fo-property-text-transform
> 
> There is "basic" support for text-transform, but
> "extended" support is 
> not available. I clicked on the "�7.16.6" link:
> 
> http://www.w3.org/TR/xsl/slice7.html#text-transform
> 
> and according to that page, the proper usage would
> be:
> 
>    text-transform="uppercase"
> 
> Are you saying this doesn't work?
> 
> If you are trying to do it based on an attributes
> value, you could try:
> 
> <xsl:choose>
>    <!-- ATTRIBUTE EXISTS -->
>    <xsl:when test="XPATH/TO/@[.='Y']">
>      <xsl:attribute
> name="text-transform">uppercase</xsl:attribute>
>    </xsl:when>
>    <!-- ATTRIBUTE DOES NOT EXIST -->
>    <xsl:otherwise>
>      <xsl:attribute
> name="text-transform">none</xsl:attribute>
>    </xsl:otherwise>
> </xsl:choose>
> 
> > I tried writing a template to convert to capital
> > letters but it doesnt work the way I need coz I am
> > setting the attribute in the parent and I need its
> > children to inherit it irrespective of the level
> of
> > depth. Hence I cant pass a specific string to the
> > conversion template. 
> 
> For the children, you might need them wrapped with
> 
>    text-transform="inherit"
> 
> (...although I would think it would automatically
> inherit...)
> 
> > If anyone has suggestion then will really
> appreciate
> > them.
> > Thanks,
> > Abhi
> 
> HTH!
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> fop-user-help@xml.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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


Re: Converting to uppercaseusing text-transform

Posted by Clay Leeds <cl...@medata.com>.
Abhijit Junnare wrote:
> Hi,
> I am using the text-transform property to convert some
> content to uppercase if an attribute has a specif
> value. I tried using font-variant="small-caps" but it
> doesnt give me the desired results. 
> I looked through the FOP documentation and it says
> that the text-transform property is NOT yet
> implemented in FOP. I am wondering if there is any
> chance that this will be implemented in FOP and if yes
> how long would it take.

According to the FOP Compliance page (watch wrap):

http://xml.apache.org/fop/compliance.html#fo-property-text-transform

There is "basic" support for text-transform, but "extended" support is 
not available. I clicked on the "§7.16.6" link:

http://www.w3.org/TR/xsl/slice7.html#text-transform

and according to that page, the proper usage would be:

   text-transform="uppercase"

Are you saying this doesn't work?

If you are trying to do it based on an attributes value, you could try:

<xsl:choose>
   <!-- ATTRIBUTE EXISTS -->
   <xsl:when test="XPATH/TO/@[.='Y']">
     <xsl:attribute name="text-transform">uppercase</xsl:attribute>
   </xsl:when>
   <!-- ATTRIBUTE DOES NOT EXIST -->
   <xsl:otherwise>
     <xsl:attribute name="text-transform">none</xsl:attribute>
   </xsl:otherwise>
</xsl:choose>

> I tried writing a template to convert to capital
> letters but it doesnt work the way I need coz I am
> setting the attribute in the parent and I need its
> children to inherit it irrespective of the level of
> depth. Hence I cant pass a specific string to the
> conversion template. 

For the children, you might need them wrapped with

   text-transform="inherit"

(...although I would think it would automatically inherit...)

> If anyone has suggestion then will really appreciate
> them.
> Thanks,
> Abhi

HTH!


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