Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
CLIPS and XML?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Torben Bang Nielsen  
View profile  
 More options Oct 12 2012, 1:31 am
From: Torben Bang Nielsen <torben.b.niel...@gmail.com>
Date: Thu, 11 Oct 2012 22:31:43 -0700 (PDT)
Local: Fri, Oct 12 2012 1:31 am
Subject: CLIPS and XML?

Hi all,

Does anyone have experience or ideas for dealing with XML data from CLIPS
code?

What I'm thinking of is building a request/reply framework where I can pass
an XML document (adhering to a given XSD) into CLIPS as facts, have the
rules do their thing and then finally build a response XML document that
adheres to the same of a different XSD.  

I'm rather new to CLIPS, but one of the thoughts I've had on this is to
represent each XML element as a deftemplate fact and then link a child
element to its parent using the parent's fact address - does this sound
reasonable?

Something like this:

(deftemplate element
(slot name (type STRING))
(slot value (default nil))
(slot parent (type INSTANCE))
(slot predecessor (type INSTANCE)))
(deftemplate attribute
(slot name (type STRING))
(slot value (default nil))
(slot parent (type INSTANCE)))

with these facts:
f-1     (element   (name "Root")   (value nil)    (parent [nil])  
 (predecessor [nil]))
f-2     (element   (name "Parent") (value nil)    (parent <Fact-1>)
(predecessor [nil]))
f-3     (attribute (name "attr")   (value "flip") (parent <Fact-2>))
f-4     (element   (name "Child")  (value "foo")  (parent <Fact-2>)
(predecessor [nil]))
f-5     (element   (name "Child")  (value "bar")  (parent <Fact-2>)
(predecessor <Fact-4>))

representing this XML document:
<Root>
  <Parent @attr="flip">
    <Child>foo</Child>
    <Child>bar</Child>
  </Parent>
</Root>

I suppose this could represent any reasonable XML document we'd encounter -
just seems like it'd be a bit tedious to navigate and then I don't know how
it would scale to big XML documents with thousands of elements?

Any examples or ideas would be greatly appreciated.

cheers,
/Torben


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Artem Novikov  
View profile   Translate to Translated (View Original)
 More options Oct 13 2012, 10:02 am
From: Artem Novikov <noviko...@gmail.com>
Date: Sat, 13 Oct 2012 07:02:13 -0700 (PDT)
Local: Sat, Oct 13 2012 10:02 am
Subject: Re: CLIPS and XML?

Parsing something using CLIPS is a bad approach.
Read about embedding CLIPS.

пятница, 12 октября 2012 г., 13:31:44 UTC+8 пользователь Torben Bang
Nielsen написал:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »