xsl-list
[Top] [All Lists]

Trouble getting a node froma a document()

2004-07-29 11:52:45
Hi again:

I have this XML in a file

<Estrutura>
   <Tabelas>
       <Tabela>
           <Nome>ProcessoTipo</Nome>
           <Indices Numero="1">
               <Indice>
                   <Campos Numero="1">
                       <Campo>
                          <Nome>ProcessoTipo_K</Nome>
                          <Visivel>0</Visivel>
                       </Campo>
                    </Campos>
               </Indice>
           </Indices>
       </Tabela>
       <Tabela>
           <Nome>ProcessoTipoGrupo</Nome>
           <Indices Numero="1">
               <Indice>
                   <Campos Numero="1">
                       <Campo>
                           <Nome>ProcessoTipoGrupo</Nome>
                           <Visivel>1</Visivel>
                       </Campo>
                    </Campos>
               </Indice>
           </Indices>
       </Tabela>
   </Tabelas>
</Estrutura>

wich i'm acessing via document() function. What i want is to get the Visivel tag value. So i'm doing

<xsl:value-of select="document(concat('Z:\DicionarioXml\',$MasterTable,'.xml'))/Estrutura/Tabelas/Tabela[Nome=$MasterTable]/Indices/Indice/Campos/Campo[Nome=(_at_)Nome]/Visivel"/>

from a node in the original xml file where i have a Nome attribute

<Campo Nome="ProcessoTipoGrupo">

and where $MasterTable = "ProcessoTipoGrupo".

So i expected the value 1, but i don't get any value.

If i omit the [Nome=(_at_)Nome] i get the value '1'. But i can have several <Campo> nodes...

If i only omit the /Visible i get nothing.

If i omit [Nome=(_at_)Nome]/Visivel i get 'ProcessoTipoGrupo01', wich is what i expected.

So it seems the problem is with @Nome? I also tryed to put that in a variable and use it, but the effect is the same.

Help, anyone? I can send the full example, but it's quite large...







<Prev in Thread] Current Thread [Next in Thread>