473,386 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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

Jun 6 '06 #1
3 1904
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
Jun 6 '06 #2


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/
Jun 6 '06 #3
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 :o) ) as this one. Keep it up.

All the best,
Greg
Jun 7 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Ramon M. Felciano | last post by:
Helo all -- I'm trying to gain a deeper understand for what type of semi-declarative programming can be done through XML and XPath/XSLT. I'm looking at graph processing problems as a testbed for...
1
by: Lars Both | last post by:
Hi everybody, i want to do the following. I have data in a XML-File. Additionaly I have a XML Schema which defines valid values for every field and alternative options. Now I want to create a...
4
by: ewosch | last post by:
Hi, with javascript, you can search the dom of an included xml-document: var resultList = xmlDocument.selectNodes(xPathExpression); using xPathExpression="//Folder This works.
6
by: acs974 | last post by:
Hi, I apologize if I am posting this in the wrong forum. I am creating a .net 2.0 website using vb.net. I have an XML file with the following general format: <LearningObjectives> <lo number =...
1
by: Nick | last post by:
I am working on a website for a client and one of their requirements was to have a mailing list. I decided to XSLT to transform "templates" to HTML so that editing was very easy and less time...
2
by: Jon | last post by:
Hi, I am testing the scenario to migrate from MSMXL4 to .NET2.0 system.xml. I experienced xsl file loading problem whenever the xsl file have a user defined script in it. The error message is as...
2
by: sebastian.langer | last post by:
Hi! Certainly somebody had my problem before and could give me just some hints, how to solve it: I have an xml file, which contains scientific data in a tree form. The data should be changed...
5
by: kebabkongen | last post by:
Hi, I have an XML source which gives me the start time (in the format hh:mi) of a program and the duration of the program (in minutes). With XSLT only, I would like to generate the time the next...
4
by: mark4asp | last post by:
I have an element, report which contains tags which have been transformed. E.g. <pis &lt;p&gt <myXml> <report>This text has html tags in it.&lt;p&gt which but <has been changed to &lt;&gt</report>...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.