Jump to content

elzahr

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About elzahr

  • Rank
    Newbie
  1. Wow, that's very nice . I will keep it in mind.Thanks!
  2. Ok, thank you all.I've done this, finally: <xsd:element name="DOC_OBL"> <xsd:complexType> <xsd:sequence> <xsd:element name="DOC_OBL_1" type="DocOBLType" minOccurs="1" /> <xsd:element name="DOC_OBL_2" type="DocOBLType" minOccurs="0" /> <xsd:element name="DOC_OBL_3" type="DocOBLType" minOccurs="0" /> <xsd:element name="DOC_OBL_4" type="DocOBLType" minOccurs="0" /> <xsd:element name="DOC_OBL_5" type="DocOBLType" minOccurs="0" /> <xsd:element name="DOC_OBL_6" type="DocOBLType" minOccurs="0" /> <xsd:element name="DOC_OBL_7" type="DocOBLType" minOccurs="0" /> <xsd:element name="DOC_OBL_8" type="DocOBLType" minOccurs="0" /> <xsd:element name="DOC_OBL_9" type="DocOBLType" minOccurs="0" /> </xsd:sequence> </xsd:complexType> </xsd:element> with this: <xsd:complexType name="DocOBLType"> <xsd:sequence> //elements.. </xsd:sequence> </xsd:complexType> It works, for now. ^^(No, no, no.. i cant change the document format, its not my concern!!)
  3. I think the solution to my problem is very easy, but i couldn't fint it :)So, here is:I have an XML which have a list of elements with different names, but in sequence. An example: <DOC> <DOC_OBL_1> <TIP_DOC_OBL>1</TIP_DOC_OBL> </DOC_OBL_1> <DOC_OBL_2> <TIP_DOC_OBL>2</TIP_DOC_OBL> </DOC_OBL_2> <DOC_OBL_3> <TIP_DOC_OBL>3</TIP_DOC_OBL> </DOC_OBL_3></DOC> So, i have 3 elements: DOC_OBL_1, DOC_OBL_2 and DOC_OBL_3. And yes, there could be number 4, 5, 6, etc.As you can se, all 3 have the same elements inside(actually, they have a lot of them, but arent important righ now), and I thinked i could declare a general type which could validate this kind of documents.How can i validate this with an Schema???I know its a very ugly XML (maybe it isnt standard, please tell me, i dont know), but It's not my concern to build this document. I just have to parse it, validate it and transform it.You can just link to the solution, any help will be wellcome.PD: im an english (language) student >.<
×
×
  • Create New...