You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Rock VZ <ro...@yahoo.com> on 2001/10/08 08:56:25 UTC

conditions in XML

Hi,

I'm new to xml.

What is the best way to structure conditions in XML.
For instance if i have 3 elements a,b,c
<a>
 <contents> aaa </contents>
</a>
<b>
 <contents> bbb</contents>
</b>
<c>
 <contents> ccc </contents>
</c>

how do i include rules in the xml doc to say that 
i> display either a OR b OR c contents in a GUI if
their contents are not empty as part of the xml doc or
a dtd.
ii> display b only if the contents of c is "ccc"

Basically i want my program logic as part of my xml
document so that the program can be generic and the
end user will need only to edit a xml document and not
the sorce code that parses it.

I want the processing rules also part of the xml data.
is this possible?

thanks
rock


=====


__________________________________________________
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Re: conditions in XML

Posted by Bob Hall <bo...@mediaone.net>.
XML stores content. There is no logic associated with the content in the XML
document. XSLT can be used to added conditional logic for elements to
indicate during a transformation of the XML document whether an element, and
various permutations of it's childern, parents siblings and such should be
included in the transformation.

I know it doesn't answer your question but the crux is that XML contains no
logic but XSLT in conjunction with XML content will do what I would guess
you are trying to do.

Bob

----- Original Message -----
From: "Rock VZ" <ro...@yahoo.com>
To: <ge...@xml.apache.org>
Sent: Monday, October 08, 2001 2:56 AM
Subject: conditions in XML


> Hi,
>
> I'm new to xml.
>
> What is the best way to structure conditions in XML.
> For instance if i have 3 elements a,b,c
> <a>
>  <contents> aaa </contents>
> </a>
> <b>
>  <contents> bbb</contents>
> </b>
> <c>
>  <contents> ccc </contents>
> </c>
>
> how do i include rules in the xml doc to say that
> i> display either a OR b OR c contents in a GUI if
> their contents are not empty as part of the xml doc or
> a dtd.
> ii> display b only if the contents of c is "ccc"
>
> Basically i want my program logic as part of my xml
> document so that the program can be generic and the
> end user will need only to edit a xml document and not
> the sorce code that parses it.
>
> I want the processing rules also part of the xml data.
> is this possible?
>
> thanks
> rock
>
>
> =====
>
>
> __________________________________________________
> Do You Yahoo!?
> NEW from Yahoo! GeoCities - quick and easy web site hosting, just
$8.95/month.
> http://geocities.yahoo.com/ps/info1
>
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org
>
>


---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Re: conditions in XML

Posted by "Thomas B. Passin" <tp...@mitretek.org>.
That's what xslt stylesheets are for, and you are on the wrong list.  Go to
the xslt list

xsl-list@lists.mulberrytech.com

But you have to be more definite about what you have in mind if you want to
get some help. Your question so far is like saying "I think I might make a
dessert.  How should I do that?".

Cheers,

Tom P

[Rock VZ]

>
> What is the best way to structure conditions in XML.
> For instance if i have 3 elements a,b,c
> <a>
>  <contents> aaa </contents>
> </a>
> <b>
>  <contents> bbb</contents>
> </b>
> <c>
>  <contents> ccc </contents>
> </c>
>
> how do i include rules in the xml doc to say that
> i> display either a OR b OR c contents in a GUI if
> their contents are not empty as part of the xml doc or
> a dtd.
> ii> display b only if the contents of c is "ccc"
>
> Basically i want my program logic as part of my xml
> document so that the program can be generic and the
> end user will need only to edit a xml document and not
> the sorce code that parses it.
>
> I want the processing rules also part of the xml data.
> is this possible?
>



---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org