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 Torsten Erler <To...@net-linx.com> on 2003/04/24 15:03:20 UTC

accessing attributes in xml

Hi all,

I've an xml like:

...
<defaultContactPerson type="PROOF"/>
<defaultContactPerson type="BILL"/>
<defaultContactPerson type="SALES">Hans Friedrich
Mueller</defaultContactPerson>
<defaultContactPerson type="MAIL"/>
<defaultContactPerson type="KEY"/>
....

Now I've to check inside the xsl this:

<xsl:if test="??? //defaultContactPerson@SALES != '' ???">

<!-- do something here if the sales contact isn't empty-->
<xsl:value-of select="??? //defaultContactPerson@SALES ???"/>

</xsl>

Can anyone help me how to check the value for the tag where the attribute is
'SALES' and how to access this value.

ThanX in Advance

cu Torsten


RE: accessing attributes in xml

Posted by Torsten Erler <To...@net-linx.com>.
Thanx -> [@type = 'SALES'] was the pointer I'm looking for -> it works well.

I tought @ goes directly to the attribute value, but wherefrom should the
parser know which attribute was meant ;(

{ Thinking is hard, if you've turned off your brain ;) }

cu Torsten
  -----Original Message-----
  From: Mirko Sertic [mailto:Mirko.Sertic@dtmgmbh.de]
  Sent: Donnerstag, 24. April 2003 15:09
  To: fop-user@xml.apache.org
  Subject: AW: accessing attributes in xml


  Sorry, i mean

  <xsl:value-of select="defaultContactPerson[@type = 'SALES']"/>

  Cheers

  Mirko
    -----Ursprüngliche Nachricht-----
    Von: Mirko Sertic [mailto:Mirko.Sertic@dtmgmbh.de]
    Gesendet: Donnerstag, 24. April 2003 15:06
    An: fop-user@xml.apache.org; Torsten.Erler@net-linx.com
    Betreff: AW: accessing attributes in xml


    I'd guess

    <xsl:value of select="defaultContactPerson[@type = 'SALES']"/>

    Hope this helps

    Cheers

    Mirko
      -----Ursprüngliche Nachricht-----
      Von: Torsten Erler [mailto:Torsten.Erler@net-linx.com]
      Gesendet: Donnerstag, 24. April 2003 15:03
      An: Fop-User (E-mail)
      Betreff: accessing attributes in xml


      Hi all,

      I've an xml like:

      ...
      <defaultContactPerson type="PROOF"/>
      <defaultContactPerson type="BILL"/>
      <defaultContactPerson type="SALES">Hans Friedrich
Mueller</defaultContactPerson>
      <defaultContactPerson type="MAIL"/>
      <defaultContactPerson type="KEY"/>
      ....

      Now I've to check inside the xsl this:

      <xsl:if test="??? //defaultContactPerson@SALES != '' ???">

      <!-- do something here if the sales contact isn't empty-->
      <xsl:value-of select="??? //defaultContactPerson@SALES ???"/>

      </xsl>

      Can anyone help me how to check the value for the tag where the
attribute is 'SALES' and how to access this value.

      ThanX in Advance

      cu Torsten


AW: accessing attributes in xml

Posted by Mirko Sertic <Mi...@dtmgmbh.de>.
Sorry, i mean

<xsl:value-of select="defaultContactPerson[@type = 'SALES']"/>

Cheers

Mirko
  -----Ursprüngliche Nachricht-----
  Von: Mirko Sertic [mailto:Mirko.Sertic@dtmgmbh.de]
  Gesendet: Donnerstag, 24. April 2003 15:06
  An: fop-user@xml.apache.org; Torsten.Erler@net-linx.com
  Betreff: AW: accessing attributes in xml


  I'd guess

  <xsl:value of select="defaultContactPerson[@type = 'SALES']"/>

  Hope this helps

  Cheers

  Mirko
    -----Ursprüngliche Nachricht-----
    Von: Torsten Erler [mailto:Torsten.Erler@net-linx.com]
    Gesendet: Donnerstag, 24. April 2003 15:03
    An: Fop-User (E-mail)
    Betreff: accessing attributes in xml


    Hi all,

    I've an xml like:

    ...
    <defaultContactPerson type="PROOF"/>
    <defaultContactPerson type="BILL"/>
    <defaultContactPerson type="SALES">Hans Friedrich
Mueller</defaultContactPerson>
    <defaultContactPerson type="MAIL"/>
    <defaultContactPerson type="KEY"/>
    ....

    Now I've to check inside the xsl this:

    <xsl:if test="??? //defaultContactPerson@SALES != '' ???">

    <!-- do something here if the sales contact isn't empty-->
    <xsl:value-of select="??? //defaultContactPerson@SALES ???"/>

    </xsl>

    Can anyone help me how to check the value for the tag where the
attribute is 'SALES' and how to access this value.

    ThanX in Advance

    cu Torsten

AW: accessing attributes in xml

Posted by Mirko Sertic <Mi...@dtmgmbh.de>.
I'd guess

<xsl:value of select="defaultContactPerson[@type = 'SALES']"/>

Hope this helps

Cheers

Mirko
  -----Ursprüngliche Nachricht-----
  Von: Torsten Erler [mailto:Torsten.Erler@net-linx.com]
  Gesendet: Donnerstag, 24. April 2003 15:03
  An: Fop-User (E-mail)
  Betreff: accessing attributes in xml


  Hi all,

  I've an xml like:

  ...
  <defaultContactPerson type="PROOF"/>
  <defaultContactPerson type="BILL"/>
  <defaultContactPerson type="SALES">Hans Friedrich
Mueller</defaultContactPerson>
  <defaultContactPerson type="MAIL"/>
  <defaultContactPerson type="KEY"/>
  ....

  Now I've to check inside the xsl this:

  <xsl:if test="??? //defaultContactPerson@SALES != '' ???">

  <!-- do something here if the sales contact isn't empty-->
  <xsl:value-of select="??? //defaultContactPerson@SALES ???"/>

  </xsl>

  Can anyone help me how to check the value for the tag where the attribute
is 'SALES' and how to access this value.

  ThanX in Advance

  cu Torsten