Jump to content

Sery

Members
  • Content Count

    6
  • Joined

  • Last visited

Posts posted by Sery

  1. Hello. I´m going insane.I´m really, REALLY bad with this, and now its like I´ve locked my brain and the examination is due wednesday. Panic. Can someone who is good at XML and XSD help me?There is something wrong in the xsd..If I remove the link to the xsd, the XML validates without problems. I´ve used xmlvalidation.com because xmllint makes my computer crash. I´ll send the files if someone replies, they are not big, a simple wordlist. Thank you! Kristin

  2. That was easy enough. It was a whole lot of "eh, what?" when I read about namespaces. Thank you! :) Here are the complete XML and XSD - enjoy! ;D XML <?xml version="1.0" encoding="iso-8859-1" standalone="no"?><?xml-stylesheet type="text/css" href="css.css"?><wordlist xmlns="http://www.w3schools.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="wordlist_english_xsd.xsd"><information> <title>Engelsk ordlista</title> <author>Kristin, Mittuniversitetet, ITM</author> <year>2012</year> </information> <wordlist_words> <word>January</word> <word>February</word> <word>Mars</word> <word>April</word> <word>May</word> <word>June</word> <word>July</word> <word>August</word> <word>September</word> <word>October</word> <word>November</word> <word>December</word> </wordlist_words></wordlist> XSD: <?xml version="1.0"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="wordlist"> <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element name="information"> <xs:complexType> <xs:sequence> <xs:element name="title" type="xs:string" minOccurs="0"/> <xs:element name="author" type="xs:string" minOccurs="0"/> <xs:element name="year" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="wordlist_words"> <xs:complexType> <xs:sequence> <xs:element name="word" nillable="true" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element></xs:schema>

  3. I figured it out for the DTD, so that is working now. :)The XML: <?xml version="1.0" encoding="iso-8859-1" standalone="no"?><?xml-stylesheet type="text/css" href="css.css"?><wordlist xmlns="http://www.w3schools.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="wordlist_english_xsd.xsd"><information xml:lang="se"> <title>Engelsk ordlista</title> <author>XXX</author> <year>2012</year> </information> <wordlist_words xml:lang="en"> And then, the schema: (where I haven´t any code for the xml:lang, it just screwed everything up.) <?xml version="1.0"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="wordlist"> <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element name="information"> <xs:complexType> <xs:sequence> <xs:element name="title" type="xs:string" minOccurs="0"/> <xs:element name="author" type="xs:string" minOccurs="0"/> <xs:element name="year" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="wordlist_words"> Also, when I´m already here.. The namespace is confusing to me. What should I have? Thanx! :)

  4. Hello! I´m almost at my breaking point, please help, I´m going bald! :D I´ve done a simple wordlist (school project) and it is in three different languages.So, I´ve added the atribte xml:lang but I cannot get it to validate! Just that bit.Tried a few different ways to write it in the DTD and XSD, but nope. This is what it looks like in the XML: <wordlist_words xml:lang="fi"> I need it to work in a external DTD, an INTERNAL DTD, and a schema. Thanx in advance! :)

×
×
  • Create New...