Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Forrest: User

<a name="xxx"> being added for @id

 

 

Forrest user RSS feed   Index | Next | Previous | View Threaded


praveen.bhatia at sumpurn

Jun 24, 2008, 11:10 AM

Post #1 of 4 (183 views)
Permalink
<a name="xxx"> being added for @id

Hello,
I need your expert advice on the following.
I use javaScript code via <script>....</script> inside xml file which
would be rendered into html later.

I use a <input id="xxx"> element too.
I noticed that document-to-html.xsl recognizes @id and adds <a
name="xxx"/> before the input element, because of which the
document.getElementById("xxx") ends up getting the wrong element.
To overcome the problem I commented out the <a name="xxx"> generation in
document-to-html.xsl, which made the code work !
What are :
1) The consequences of this change to what forrest normally expects or does?
2) What could be a better workaround than the hack that I did?

Praveen


rgardler at apache

Jun 24, 2008, 1:06 PM

Post #2 of 4 (178 views)
Permalink
Re: <a name="xxx"> being added for @id [In reply to]

Dr. Bhatia Praveen wrote:
> Hello,
> I need your expert advice on the following.
> I use javaScript code via <script>....</script> inside xml file which
> would be rendered into html later.
>
> I use a <input id="xxx"> element too.
> I noticed that document-to-html.xsl recognizes @id and adds <a
> name="xxx"/> before the input element, because of which the
> document.getElementById("xxx") ends up getting the wrong element.

eh?
getElementById does what it says. It gets the element with a given id.
It shouldn't (can't?) return the anchor element with the name attribute.
Are you sure you diagnosed tho real problem?

> To overcome the problem I commented out the <a name="xxx"> generation in
> document-to-html.xsl, which made the code work !
> What are :
> 1) The consequences of this change to what forrest normally expects or does?

The most immediate side effect will be that table of contents and other
cross referencing will not work.

> 2) What could be a better workaround than the hack that I did?

Lets see if this really in the problem.

Ross


praveen.bhatia at sumpurn

Jun 24, 2008, 4:45 PM

Post #3 of 4 (175 views)
Permalink
RE: <a name="xxx"> being added for @id [In reply to]

Hi,
Intuitively I also felt strange that <a name="xxx"> and < input id="xxx">
should get entangled this way. In the <input > element I did not give any
name attribute but when in the JavaScript I did:
alert(document.getElementById("xxx").name) it gave "xxx" !

When I comment out the <a name=""> generation in the document-to-html.xsl
alert gives "undefined" and <input id="xxx" > responds correctly to any
changes made to its value by JavaScript.

I use internet explorer Version 6.0 (Japanese version). Could it be due the
browser?

Praveen

-----Original Message-----
From: Ross Gardler [mailto:rgardler [at] apache]
Sent: Wednesday, June 25, 2008 6:07 AM
To: user [at] forrest
Subject: Re: <a name="xxx"> being added for @id

Dr. Bhatia Praveen wrote:
> Hello,
> I need your expert advice on the following.
> I use javaScript code via <script>....</script> inside xml file which
> would be rendered into html later.
>
> I use a <input id="xxx"> element too.
> I noticed that document-to-html.xsl recognizes @id and adds <a
> name="xxx"/> before the input element, because of which the
> document.getElementById("xxx") ends up getting the wrong element.

eh?
getElementById does what it says. It gets the element with a given id.
It shouldn't (can't?) return the anchor element with the name attribute.
Are you sure you diagnosed tho real problem?

> To overcome the problem I commented out the <a name="xxx"> generation in
> document-to-html.xsl, which made the code work !
> What are :
> 1) The consequences of this change to what forrest normally expects or
does?

The most immediate side effect will be that table of contents and other
cross referencing will not work.

> 2) What could be a better workaround than the hack that I did?

Lets see if this really in the problem.

Ross


rgardler at apache

Jun 25, 2008, 1:39 AM

Post #4 of 4 (175 views)
Permalink
Re: <a name="xxx"> being added for @id [In reply to]

[Please use inline responses, it makes the archives more readable]

Dr. Bhatia Praveen wrote:
> Hi,
> Intuitively I also felt strange that <a name="xxx"> and < input id="xxx">
> should get entangled this way. In the <input > element I did not give any
> name attribute but when in the JavaScript I did:
> alert(document.getElementById("xxx").name) it gave "xxx" !

Can you please post a snippet of the HTML and javascript that is
displaying this behaviour.

> When I comment out the <a name=""> generation in the document-to-html.xsl
> alert gives "undefined" and <input id="xxx" > responds correctly to any
> changes made to its value by JavaScript.

Likewise, please provide the same snippets that display this behaviour.

> I use internet explorer Version 6.0 (Japanese version). Could it be due the
> browser?

I doubt it. Lets try some experimentation.

Ross

>
> Praveen
>
> -----Original Message-----
> From: Ross Gardler [mailto:rgardler [at] apache]
> Sent: Wednesday, June 25, 2008 6:07 AM
> To: user [at] forrest
> Subject: Re: <a name="xxx"> being added for @id
>
> Dr. Bhatia Praveen wrote:
>> Hello,
>> I need your expert advice on the following.
>> I use javaScript code via <script>....</script> inside xml file which
>> would be rendered into html later.
>>
>> I use a <input id="xxx"> element too.
>> I noticed that document-to-html.xsl recognizes @id and adds <a
>> name="xxx"/> before the input element, because of which the
>> document.getElementById("xxx") ends up getting the wrong element.
>
> eh?
> getElementById does what it says. It gets the element with a given id.
> It shouldn't (can't?) return the anchor element with the name attribute.
> Are you sure you diagnosed tho real problem?
>
>> To overcome the problem I commented out the <a name="xxx"> generation in
>> document-to-html.xsl, which made the code work !
>> What are :
>> 1) The consequences of this change to what forrest normally expects or
> does?
>
> The most immediate side effect will be that table of contents and other
> cross referencing will not work.
>
>> 2) What could be a better workaround than the hack that I did?
>
> Lets see if this really in the problem.
>
> Ross
>

Forrest user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.