Este site está com funcionalidades limitadas enquanto realizamos manutenção para melhorar sua experiência de uso. Se nenhum artigo resolver seu problema e você quiser fazer uma pergunta, nossa comunidade de suporte pode te ajudar em @FirefoxSupport no Twitter e /r/firefox no Reddit.

Pesquisar no site de suporte

Evite golpes de suporte. Nunca pedimos que você ligue ou envie uma mensagem de texto para um número de telefone, ou compartilhe informações pessoais. Denuncie atividades suspeitas usando a opção “Denunciar abuso”.

Saiba mais

Esta discussão foi arquivada. Faça uma nova pergunta se precisa de ajuda.

How to get Firefox to follow an anchor fragment in XSLT stylesheet generated HTML

  • 2 respostas
  • 2 têm este problema
  • 11 visualizações
  • Última resposta de cor-el

more options

I have an XML file that is being transformed to HTML at load time by the browser via an XSLT stylesheet - something like this:

<?xml  version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="transform.xsl" title="example" type="text/xsl"/>
<foo>
  <bar baz="1">Hello</bar>
  <bar baz="2">my name is</bar>
  <bar baz="3">Inigo Montoya</bar>
</foo>

The XML gets converted into HTML via the stylesheet, something like this:
<html>
  <head/>
  <body>
    <div class="bar" id="1">Hello</div>
    <div class="bar" id="2">my name is</div>
    <div class="bar" id="3">Inigo Montoya</div>
  </body>
</html>

The transform runs just fine, the HTML generates and is displayed, BUT: If I give the browser a url like:

 file:///tmp/foo.xml#2

while the browser renders the file fine, it does NOT move the viewport to the selected div (assuming the generated HTML is larger than a screenfull, naturally). I've also tried adding <a name="2"/> and <a id="2"/> elements to the generated HTML as well, with no observed change.

I have an XML file that is being transformed to HTML at load time by the browser via an XSLT stylesheet - something like this: <pre><nowiki><?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="transform.xsl" title="example" type="text/xsl"/> <foo> <bar baz="1">Hello</bar> <bar baz="2">my name is</bar> <bar baz="3">Inigo Montoya</bar> </foo> The XML gets converted into HTML via the stylesheet, something like this: <html> <head/> <body> <div class="bar" id="1">Hello</div> <div class="bar" id="2">my name is</div> <div class="bar" id="3">Inigo Montoya</div> </body> </html></nowiki></pre> The transform runs just fine, the HTML generates and is displayed, BUT: If I give the browser a url like: file:///tmp/foo.xml#2 while the browser renders the file fine, it does NOT move the viewport to the selected div (assuming the generated HTML is larger than a screenfull, naturally). I've also tried adding <a name="2"/> and <a id="2"/> elements to the generated HTML as well, with no observed change.

Alterado por cor-el em

Todas as respostas (2)

more options

I didn't realise the system would eat my tags:

 Example (with <> replaced with () to keep from being processed:)
 (?xml)
 (?xml-stylesheet href="transform.xsl" title="example" type="text/xsl" ?)
 (foo) 
   (bar baz="1")Hello(/bar)
   (bar baz="2")my name is(/bar)
   (bar baz="3")Inigo Montoya(/bar)
 (/foo)

Output (with <> replaced with () to keep from being processed)

 (html)
 (head/)
 (body)
 (div class="bar" id="1")Hello(/div)
 (div class="bar" id="2")my name is(/div>
 (div class="bar" id="3")Inigo Montoya(/div>
 (/body)
 (/html)
more options

A good place to ask advice about web development is at the MozillaZine "Web Development/Standards Evangelism" forum.

The helpers at that forum are more knowledgeable about web development issues.
You need to register at the MozillaZine forum site in order to post at that forum.