Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optional Field/element in output
Message
 
To
28/07/2007 09:48:40
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
01244346
Message ID:
01244354
Views:
22
>>>Yes, Borislav - thanks, I know that, but I would like the line to disappear from the output, ie no tag field
>>>
>>>Based on a condition I have to output either A1 or A2, but not both
>>
>>Why?
>
>Below a part of a schema
>
>
>- <xs:complexType>
>- <xs:sequence>
>- <xs:choice>
>  <xs:element ref="QUARTER" />
>  <xs:element ref="MONTH" />
>  </xs:choice>
>  <xs:element ref="YEAR" />
>  </xs:sequence>
>  </xs:complexType>
>
>
>So I have to produce
>
>
>either
>
><PERIOD>
>   <QUARTER>1</QUARTER>
>   <YEAR>2007</YEAR>
></PERIOD>
>
>or
>
><PERIOD>
>   <MONTH>3</MONTH>
>   <YEAR>2007</YEAR>
></PERIOD>
>
>
Is this works for you:
CLEAR
SET ASSERTS ON
create cursor period ;
    (QUARTER        c(10), ;
     YEAR           c(10) ;
    )

create cursor PERIOD1 ;
    (MONTH        c(10), ;
     YEAR         c(10) ;
    )

    insert into PERIOD values('1', '10')
    insert into PERIOD values('2', '20')

    insert into PERIOD1 values('11', '11')
    insert into PERIOD1 values('12', '21')

    local xml, i, s
    xml = createobject('xmladapter')

    =xml.AddTableSchema('period')
    =xml.AddTableSchema('PERIOD1',.T.,STRCONV([PERIOD],12))
    xml.xmlSchemalocation=''
    ? xml.ToXml('s',[],.t.)
You have both but if you don't use case sensitive parsing after that :-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform