compound doc, using html, svg, JavaScript and XPath (XSLT)

Discussion in 'XML' started by Greg, Jun 6, 2006.

  1. Greg

    Greg Guest

    Hi,

    I want to create a web based interface that uses a form + Javascript (in
    an XHTML namespace) to construct an XPath to query and modify the
    attributes of some SVG (in an SVG namespace).

    There are lots of Google hits on each of these specifications and related
    technology, shuch as namespaces but there's almost nothing I can find that
    shows useful examples of the different ways they might be combined?

    Can I, for example, construct a single document (splitting out the XSLT &
    JavaScript is something I want to avoid at the moment), that has
    namespaces for the XHTML, the XSLT and the SVG. If so, can you show me a
    simple "Hello SVGWorld" example or post a link to a site with examples.

    Many thanks,

    Greg
    Greg, Jun 6, 2006
    #1
    1. Advertising

  2. See recent discussion of including XSLT in the same document as the
    source data.

    Javascript is semi-orthogonal to that. As far as XSLT is concerned, it's
    just character data to be copied into the right places. I'd suggest
    designing your final document first, then working back from that to the
    XSLT you need to produce this from your source representation.

    General observation: The more common approach is to use XSLT to produce
    XHTML, not to embed the XSLT into the XHTML.





    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
    Joe Kesselman, Jun 6, 2006
    #2
    1. Advertising

  3. Greg wrote:

    > I want to create a web based interface that uses a form + Javascript (in
    > an XHTML namespace) to construct an XPath to query and modify the
    > attributes of some SVG (in an SVG namespace).


    > Can I, for example, construct a single document (splitting out the XSLT &
    > JavaScript is something I want to avoid at the moment), that has
    > namespaces for the XHTML, the XSLT and the SVG. If so, can you show me a
    > simple "Hello SVGWorld" example or post a link to a site with examples.


    I am not sure it makes much sense usually to keep XSLT and XHTML or SVG
    in the same document without having an additional XML input document.
    But of course XHTML and SVG and script doing XPath is possible, here is
    a simple example that works with Firefox 1.5 and with Opera 9 beta
    <http://home.arcor.de/martin.honnen/svg/test2006060601.xhtml>

    The circles and rectangles in the SVG graphics initially have black as
    the fill color and then the user can input a fill color and set that for
    the selected shapes.
    The example uses the W3C DOM Level 3 XPath API although
    getElementsByTagNameNS would suffice for the application. But you wanted
    an example with XPath so I used XPath.



    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jun 6, 2006
    #3
  4. Greg

    Greg Guest

    Martin.

    Many thanks for the example. It's pretty much exactly what I was looking
    for. I'd overcomplicated it (in my head). Thanks for straightening me out.
    --------
    Joe.

    Thanks for the pointer to "including SVG" subject. Useful stuff.
    --------
    On a more general note. It's rare nowadays to find a newsgroup that's
    quite as open and helpful (and quick :eek:) ) as this one. Keep it up.

    All the best,
    Greg
    Greg, Jun 7, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    3
    Views:
    496
    Tor Iver Wilhelmsen
    Sep 17, 2004
  2. Arne Nordmann
    Replies:
    0
    Views:
    520
    Arne Nordmann
    Jun 28, 2004
  3. Mardagg
    Replies:
    0
    Views:
    803
    Mardagg
    May 12, 2006
  4. Mardagg
    Replies:
    0
    Views:
    659
    Mardagg
    May 12, 2006
  5. Scott Zabolotzky
    Replies:
    2
    Views:
    334
    Joseph Kesselman
    Sep 7, 2006
Loading...

Share This Page