Re: [xml] Constructing Regular Expression in libxml



Hi
I am looking for some thing like this
 
<xs:element name ="book">
<xs:complexType>
<xs:sequence>
<xs:element name ="Math"/>
<xs:element name ="Science/>
</xs:sequence>
</xs:complexType>
</xs:element/>
 
The regx for this will be some thing like this
{ns:book} {
   BEGIN NEW STATE TO PROCESS CHILD ELEMENTS
}
{ns:Math}{ns:Science}
{
may or may not have new states here depending upon the xsd.
}
 
 
similarly attributes can be processed using the parents rule and having a link to the new rule using(BEGIN new state) to process attributes.
ultimately this becomes very easy to process the xsd in any native languages
 
or this can even be better regex , like single _expression_ for the start of element till the end of element . etc. 
This is the only literature I am having it , just a thought .
Am I making any sense or please let me know If I am not to the point
Thanks
S.Srivatsan.
 
Daniel Veillard <veillard redhat com> wrote:
On Thu, May 04, 2006 at 10:05:12AM +0100, srivatsan s wrote:
> I want to know whether there is any way to construct a regular _expression_ out of the schema (xsd) file .

basically no. If you have a pointer to solid litterature showing this
is even possible (attributes ? content ?) please pass the pointer
but in general I just think your request makes little sense.

> some thing like this
>
>
>
>
>

>
>


libxml compiles to element content to automatas, not to regexps,
those automatas have counters.
they don't have a regexp serialization form in general, that might be
doable, it may as well been unreadable (e.g. xs:all), and I don't see how
you would express rules about attributes, content, and namespaces.

Daniel

--
Daniel Veillard | Red Hat http://redhat.com/
veillard redhat com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/


Yahoo! India Answers: Share what you know. Learn something new. Click here
Send instant messages to your online friends - NOW

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]