Re: referencing elements inside a xml document

Subject: Re: referencing elements inside a xml document
From: Jeni Tennison <Jeni.Tennison@xxxxxxxxxxxxxxxx>
Date: Wed, 24 May 2000 11:16:24 +0100
Mihaela,

>What I've made so far: when formatting that element, an HTML <A> target
element 
>was added ( <A NAME="id" /> ), and from the Xlink specification I've
extracted 
>the inside pointer and added it to a HTML <A> reference (<A 
>HREF="file_name.xml#id"/> ). But it doesn't work, it just points to the 
>begining of the XML document. 

I am confused by the <A HREF="file_name.xml#id">...</A> because it seems to
be pointing to an XML file rather than to an HTML file (i.e. the extension
is '.xml' rather than '.html').  From your description, you seem to be
converting both files to HTML (e.g. adding the <A NAME="id">...</A> to the
one that's being pointed to).

If I've interpreted correctly, and you've converted both your original
files into HTML and are linking between those two HTML files, two
possibilities spring to mind:

1. You're pointing to the original XML file rather than the HTML file
   that has the <A NAME="id">...</A> elements in it.  Make sure that
   you're linking to the right file.

2. You've given the HTML file that you're linking to an '.xml' extension
   which may mean that the document is being interpreted as an XML file 
   rather than an HTML file.  Try giving the file you're linking to 
   has an '.html' extension instead. 

If you're linking into the original XML file on purpose, or you've
converted the referenced file into another XML file with some HTML
qualities, then there are are another two possibilities:

3. You haven't defined the document type (DOCTYPE) of the file you're 
   linking into, so the browser doesn't know that the NAME attribute of 
   the A element is an ID attribute.  If it doesn't know that 'NAME' is 
   an ID attribute, then it doesn't know that #id refers to that element.  
   Defining the A element and NAME attribute might help.

4. The browser you're using doesn't support XPointer and so doesn't know 
   how to jump to an anchor within XML documents.  I'm pretty sure that 
   this is likely because of the current state of XPointer (it's not a 
   recommendation yet), but would be happy for others to correct me if 
   I'm wrong.  There's not really anything that you can do about this.

As you said, issues about pointers and linking and things isn't really
appropriate here.  Perhaps you should try XML-L instead, or xlxp-dev if
it's still up and running (?)

Hope that helps,

Jeni

Dr Jeni Tennison
Epistemics Ltd, Strelley Hall, Nottingham, NG8 6PE
Telephone 0115 9061301 ? Fax 0115 9061304 ? Email
jeni.tennison@xxxxxxxxxxxxxxxx



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread