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

G

Greg

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
 
J

Joe Kesselman

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.
 
M

Martin Honnen

Greg said:
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.
 
G

Greg

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top