Jump to content

icedragon208

Members
  • Content Count

    5
  • Joined

  • Last visited

Posts posted by icedragon208

  1. Hello,

    i am new to xslt and I have a problem. I have a XML file, for example like this:

    <output>     	<object>     		<text id="one"> Example Text 1 </text>     	</object>     		.     		.     		.     	<object>     		<text id="seven"> Example Text 7 </text>     	</object>     		.     		.     		.</output>

    And I want to read the Text from <text id="seven">

     

    i tried it with this,

    <xsl:value-of select="/output/object/text[@id='seven']"/>

    but it dont works. Can someone please tell me why?

     

    Thank you.

  2. Hello, i have a question and hope some on can help me :-) .

    I have 2 XML files and 1 XSL Transformation. I will show you an example.

    First one is empty and i want to fill it:

    <Cars>      <vehicle1>                <text></text>                <attribute>                             <attributeOne atr1="no"></attributeOne>                             <attributeOne atr1="no"></attributeOne>                </attribute>      </vehicle1>      <vehicle2>               <text></text>               <attribute>                            <attributeOne atr1="no"></attributeOne>                            <attributeOne atr1="no"></attributeOne>               </attribute>     </vehicle2></Cars>

    Second one is an export from a Programm with the information i need:

    <Information>             <vehicle1 information="Corvette 1,2"></vehicle1111>             <vehicle2 information="Opel 1 Cadett"></vehicle1111></Information>

    now i want to fill the xml file 1 with the information.

    Normally i can use xsl:value-of select=".."

    But The Problem is

    with the Information information="Opel 1 Cadett"The output in the first fiel should be<text>Opel Cadett</text><attribute>           <attributeOne atr1="yes"></attributeOne>           <attributeOne atr1="no"></attributeOne></attribute>

    I tired to use sub-string but nothing worked :sorry:

  3. Hello,first sorry for my bad english, i am from germany. I have a xml file (this is just a example)

    <ROWDATA><ROW  NAME="Dert*Test*Nr1" GRUPPE ="Gut*&*fein" /><ROW  NAME="Dert*Test*Nr2" GRUPPE ="lecker*&*fein" /><ROW  NAME="Dert*Test*Nr3" GRUPPE ="lecker*&*fein" /><ROW  NAME="Dert*Test*Nr4" GRUPPE ="Gut*&*fein" /></DATAPACKET></ROWDATA>

    now i want to read out the NAME attribut, according to the right GRUPPE attribut.For example, if i want to have "Der Test Nr2"

    <text>	 <xsl:for-each select="/DATAPACKET/ROWDATA/ROW">	  <xsl:if test="/DATAPACKET/ROWDATA/ROW/@GRUPPE = 'lecker*&*fein' ">	   <xsl:value-of select="/DATAPACKET/ROWDATA/ROW/@NAME"/>	  </xsl:if>	 </xsl:for-each>   </text>

    but this dont work :-(

×
×
  • Create New...