Skip to main content.
home | support | download

Back to List Archive

Re: XML attributes in XML element content

From: Dave Moreau <davidjmoreau(at)not-real.hotmail.com>
Date: Thu Feb 19 2004 - 06:03:32 GMT
On Mon, 16 Feb 2004 08:07:02 -0800 (PST) Bill Moseley wrote:
>On Sun, Feb 15, 2004 at 07:29:11PM -0800, Dave Moreau wrote:
> > I would like to be able to specify how swish-e treats attributes
> > that are defined. As of now, we can specify default behavior for
> > undefined attributes and elements, but I would like to be able to
> > specify such options for defined attributes.
>
>Can you describe a way to do it? My problem is that XML is too general
>of a way to describe data -- so it's really hard to have general
>purpose configuration options that works for all cases.  I just think
>it's easier to write a small script to parse the data in a way that
>makes sense to you and then feed that to swish.
>
>The current options for parsing XML are very limited.

Thanks for the answer.

Basically, I want to be able to return properties that appear in the middle 
of the document without them being included in the containing context. For 
the file

  <elem attrib="blah">nonsense</elem>

where elem is defined

  MetaNames elem

and attrib is defined

  PropertyNames elem.attrib

And 'elem' is an alias for 'swishdefault', I do not want 'blah' to be 
indexed as appearing in elem. Searching the index with '-w blah' should not 
return this document, but '-p elem.attrib' should return the property.

I find it interesting that the property appears in it's context, yet the 
context disappears when swish-e returns the property. For example:

  <elem attrib="blah">nonsense</elem> lksjfs ds dsfs df  <elem 
attrib="lalala">more </elem>

My experience is that using '-p elem.attrib' returns a space delimited 
string of all occurances of elem.attrib (thus "blah lalala" would be 
returned). I like this behavior. I wish I could specify:

  PropertyNames   elem.attrib

when I want it indexed and

  PropertyNamesNoIndex   elem.attrib

when I don't.

dave

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail
Received on Wed Feb 18 22:03:33 2004