Jump to content

thatsme

Members
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

0 Neutral

About thatsme

  • Rank
    Newbie
  1. Hi, this is a piece of my transf.xslt document. Unfortunately, second template does not create table. It correctly reads values from xml file but displays them in the single line in the result file instead of putting them into table. Could anyone of you tell what is wrong? <xsl:template match="/"> <html xmlns="http://www.w3.org/1999/xhtml"> <body style="background-color: #B4EEB4"> <xsl:for-each select="Countries/DescribedCountryArmy"> <xsl:sort select="Name"/> <h1 style="font-family: verdana; font-size: 16pt; color: #8B7E66"> <xsl:number format="1. " value="position()"/> <xsl:value-of select="Name"/> </h1> <p style="font-family: verdana; font-size: 12pt"> Yearly military expenses: <xsl:value-of select="MilitaryExpensesFromGDP"/>%; <br/> Comander of the army: <xsl:value-of select="Commander"/>; <xsl:apply-templates select="LandForces"/> <xsl:apply-templates select="AirForces"/> <xsl:apply-templates select="Navy"/> </p> </xsl:for-each> </body> </html> </xsl:template> <xsl:template match="LandForces"> <table border="1" style="background-color:#9BCD9B"> <tr> <td> <xsl:value-of select="local-name()"/> </td> <td> fgbfgv</td> </tr> <tr> <td>Date of foundation</td> <td> <xsl:value-of select="FoundationDate"/> </td> </tr> <tr> <td>Count of military personnel</td> <td> <xsl:value-of select="MilitaryPersonnel"/> </td> </tr> <tr> <td>Count of tanks</td> <td> <xsl:value-of select="Tanks"/> </td> </tr> </table> </xsl:template>
  2. Hi, i need help from smart web developer. I googled, but did not find any information how to define list of complexType items. I unsuccessfully tried this: <xs:element name="myElement" type="elementsList"><xs:simpleType name="elementsList"> <xs:list itemType="xs:myComplexType"/></xs:simpleType> myComplexType is defined. Any ideas how to solve that problem?
  3. Thanks, no it works . boen_robot THE SAVIOR
  4. I get error massage for averyone usage of use attribute. i have also tried to use minOccurence and max Occurencer and got same errprs
  5. Hi, i am new to xml schema. I wrote my schema and when i try to validate it i get such error: file:///usr/local/XSV/xsvlog/tmppWDZw9uploaded:6:2: Invalid per cvc-complex-type.1.3: undeclared attribute {None}:use . Any ideas how to solve it?Here's my code (i highlithed places where i am using "use" attribute): <?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs ="http://www.w3.org/2001/XMLSchema"> <xs:element name = "Country" type = "countryType"/> [b]<xs:attribute name ="name" type = "xs:string" use = "required"/>[/b] <xs:complexType name ="countryType"> <xs:sequence> <xs:element name = "Commander" type = "xs:string"/> <xs:element name = "MilitaryExpensesFromGDP" type = "militaryExpensesFromGDPType"/> <xs:element name = "LandForces" type = "landForcesType"/> <xs:element name = "AirForces" type = "airForcesType"/> <xs:element name = "Navy" type = "navyType"/> </xs:sequence> </xs:complexType> <xs:simpleType name = "militaryExpensesFromGDPType"> <xs:restriction base = "xs:float"> <xs:minInclusive value = "0"/> <xs:maxInclusive value = "100"/> </xs:restriction> </xs:simpleType> <xs:complexType name = "landForcesType"> <xs:sequence> <xs:element name = "FoundationDate" type = "xs:date"/> <xs:element name = "MilitaryPersonnel" type = "xs:long"/> <xs:element name = "Tanks" type = "xs:long"/> <xs:element name = "FamousBattle" type = "famousBattleType"/> <xs:element name = "FoughtWar" type = "foughtWarType"/> </xs:sequence> </xs:complexType> <xs:complexType name = "airForcesType"> <xs:sequence> <xs:element name = "MilitaryPersonnel" type = "xs:long"/> <xs:element name = "Aircraft" type = "xs:long"/> <xs:element name = "FamousBattle" type = "famousBattleType"/> <xs:element name = "FoughtWar" type = "foughtWarType"/> </xs:sequence> </xs:complexType> <xs:complexType name = "navyType"> <xs:sequence> <xs:element name = "MilitaryPersonnel" type = "xs:long"/> <xs:element name = "Vessels" type = "xs:long"/> <xs:element name = "FamousBattle" type = "famousBattleType"/> <xs:element name = "FoughtWar" type = "foughtWarType"/> </xs:sequence> </xs:complexType> <xs:complexType name = "famousBattleType"> <xs:sequence> <xs:element name = "FoundationDate" type = "xs:date"/> <xs:element name = "Enemies" type = "xs:string"/> [b]<xs:attribute name = "battleTitle" type = "xs:string" use = "required"/>[/b] </xs:sequence> </xs:complexType> <xs:complexType name = "foughtWarType"> <xs:sequence> <xs:element name = "DateOfBegining" type = "xs:date"/> <xs:element name = "DateOfEnd" type = "xs:date"/> [b]<xs:attribute name = "warTitle" type = "xs:string" use = "required"/>[/b] </xs:sequence> </xs:complexType></xs:schema> i would appreciate any help!
×
×
  • Create New...