From jan@swi.psy.uva.nl Tue Oct  9 22:09:14 2001
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f99K9Et12808;
	Tue, 9 Oct 2001 22:09:14 +0200 (MET DST)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f99K9Ed32486;
	Tue, 9 Oct 2001 22:09:14 +0200
Date: Tue, 9 Oct 2001 22:09:14 +0200
Message-Id: <200110092009.f99K9Ed32486@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: [SWIPL] Processing XML containing attribute values begining with _
To: Chris Fox <foxcj@dcs.kcl.ac.uk>, prolog@swi.psy.uva.nl
In-Reply-To: Chris Fox's message of Tue, 09 Oct 2001 17:36:50 +0100
Phone: +31 - 20 - 525 6121
Cc: Chris Fox <foxcj@dcs.kcl.ac.uk>

Chris,

> I am using sgml_parse to extract information from XML documents.  Some of 
> these documents contain attribute-values such as name="_exp" (where the value 
> begins with an underscore).
> 
> sgml_parse appears to produce an appropriate term representation, of the form 
> (name=_exp), except that such values are (unfortunately) interpreted as 
> variables under unification, and not atoms, which makes it hard (impossible?) 
> to extract the value.
> 
> Is there some way of forcing entities/values of this sort to be 
> represented/interpreted as true atoms (or strings) e.g. '_exp'?

They are.  Consider:

<?xml version="1.0"?>

<test name="_value">
</test>


?- load_xml_file('x.xml', T).

T = [element(test, [name='_value'], [])]

I don't know what you are doing.  Things go wrong if you use write/1 to
write the term to a file and read/1 to get it back.  Do you have example
code for us?

	Regards --- Jan

