I second the WROX XML book recommendation. Beginning XML is good high-level coverage of most XML-related topics. The XSLT Programmer's Reference has saved my job a few times.
Uura ~~~~
"Common sense tells you that the world is flat."
You just have to define the namespace in the root element of your XSL file.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:space="www.namespace.com/example" version="1.0">
Then use the namespace prefix when matching elements.
<xsl:variable...
The only free C (not C++) parser I've read about is expat. You have a lot more choices with C++. I haven't used it and have no contacts that have tried - so no recommendations here, but for FWIW...
http://www.jclark.com/xml/expat.html
Uura ~~~~
"Common sense tells you that the world...
A book on XHTML might be handy, but in all likelyhood you'll be taking XML data and using XSLT to transform it into HTML or XHMTL (your choice). It's good XML practice to use XHTML since it will be a well formed document (all open tag have corresponding close tags, etc.). It truth there isn't...
I'd recommend you go with Tarwn's idea. Store some identifier or even the filename (if you're only using the XML document locally) and have the XSL create a link. That's what's usually done around here when generating HTML pages.
Uura
~~~~
"Common sense tells you that the world is...
I'll second the WROX recommendation that Nosferatu made. The XSLT Programmer's Reference has saved my sanity more than once.
Uura
~~~~
"Common sense tells you that the world is flat."
The parser thinks you're adding tags when you are really just adding text. Try escaping the "<" at least, using <
I don't think you need to escape anything else.
Uura
~~~~
"Common sense tells you that the world is flat."
The previous poster is right. You have to write the file back in order to save it. You probably don't need to reload it if you made the changes to your document object. It should still be valid.
Uura
~~~~
"Common sense tells you that the world is flat."
You have the addition problem of namespace prefixes on your data types. You should check your parser documentation for how to get namespace prefixed elements out of an XML Document. The three parsers I've looked at do this in very different ways. Which DOM parser are you using?
Under MSXML...
Be advised that XML does not require parsers to retain comments in XML documents. Some will, since COMMENT_NODE is a valid node type, but a lot of parsers just strip comments.
Just make sure that anything in comments inside XML is not relevant to others who parse the document. They may not...
The Professional XML Schemas book from WROX publishers is an excellent reference for XML Schema. It's a little rough to get through at first, but great at answering these questions when they come up.
Uura
~~~~
"Common sense tells you that the world is flat."
Be careful with schema generated from XMLSpy. Their schema generator is good compared to others, but still often makes bad assumptions about your data model. Look especially for attributes and values that are handled by enumerated lists where you really just wanted any xs:string or xs:NMTOKEN...
SOAP was originally created to do RPC (Remote Procedure Call) and the syntax is in just about every SOAP reference you can find. SOAP will work without WSDL and all the other web services hoopla.
You're basically right, you just need to place the XML data into the SOAP envelope and send it...
Don't know your environment or requirements, but there are a few decent free parsers that do most of the latest stuff. I haven't worked with too many older parsers (read - over a year old), so I'm afraid I can't talk to the differences. Sorry.
Uura
~~~~
"Common sense tells you that...
I don't know if this is your problem, but in the first 'when' element:
<xsl:when test="count(PERFORMER/@CID) = 1">
This is true when the number of PERFORMER element that have a CID attribute is equal to 1. I don't think this is what you're after here.
As to your problem - This is...
If no template is specified in an XSL document for an element, a default rendering is performed. The default is just printing out the text contents of the element.
In your case, there is probably no difference between using apply-templates and value-of, but if the XSL designer just wants the...
If you are building pages using XSLT and keep the common information fairly small, you could just include the files as variables in your display XSL file.
<xsl:variable name="commonNav" select="document(<filename>)"/>
Then access the data using standard variable syntax...
In each table element, you select all questions for that date, but only do something with the first (position()=1). Why not just select the first element and save yourself all the looping time. Don't know how much time it will save you, but if there are a lot of questions, it may be what is...
In addition to specifying the 'targetNamespace' attribute in the xs:schema, our parser always insists on our also specifying 'xmlns' equal to the same value. That way it assumes all elements below are in the given namespace unless otherwise prefixed. Of course, all schema elements now require...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.