|
I've tried. Same story.
But it's not unusual. I had a problem with the pattern facet also. Guess MSXML has to grow up a bit.
If you need the sources i can send them to you.
rechi
|
|
|
|
|
Thanks for your kindness , but no thanks
Be The First
|
|
|
|
|
I save comments from people in a XML file, but when I view it in IE it just show me the half or so ofthe data between a block.
I know that '&' is not alowed in XML but is there any others?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Its not that it isnt allowed, its just that to use it you must escape it. The restricted characters and their escaped versions are:
& == &
' == '
> == >
< == &lt;
" == &quot;
So:
"The fat cat & his dog"
Becomes:
&amp;The fat cat &amp; his dog&amp;
|
|
|
|
|
I'm learning XML now. Creating a simple xml file which is as follows:
<customer id="xyz">
<name>
<first>John
<middle>Smithy
<last>Doe
<line1>123 Some Street <line2>P.O. Box 555 <city>Anytown
<state>NC
<zip>55555
<phone>
<home>5551212
<work>5551213
<online>
<email>john@doe.com
<url>http://www.doe.com
but when trying to run it in IE6, is returned the following error:
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
The system cannot locate the resource specified. Error processing resource 'customer.dtd'. Error processing resource 'file:///D:/XMLExcise/xml1.xml'. Line 2, Position 42
So, what does this mean and what's the solution for it? Thanks!
|
|
|
|
|
Im guessing some things got stripped out of your post... the easiest solution to the error is just to remove the
|
|
|
|
|
Are there any documents or arctles that you have read explains XML for a starter?
not elaborately,but basic conceptions,with examples preferably,short but to point for future learning.
Thanks.
this is my signature for forums quoted from shog*9:
I can't help but feel, somewhere deep within that withered, bitter, scheming person, there is a small child, frightened, looking a way out.
|
|
|
|
|
zhoujun wrote:
Are there any documents or arctles that you have read explains XML for a starter?
There are billions, which is part of the problem.
Here are a few good ones:
And if you have any problems or questions just ask here.
|
|
|
|
|
Thanks,Paul.
I will check them out.
And if you have any problems or questions just ask here.
Yes,I will never hesitate to ask "silly" questions.
this is my signature for forums quoted from shog*9:
I can't help but feel, somewhere deep within that withered, bitter, scheming person, there is a small child, frightened, looking a way out.
|
|
|
|
|
Does anyone know how to call a stylesheet and pass in a variable value ? I'm doing some docs using the XML generated by .NET and I want to pass in the node to look up for each page that documents one function, so I can pull out the parameters, etc. I hope to do this with one XSL, but at the moment it's something like
<xsl;for-each select="[contains[@name, "M:XMLObject:functionname"]/>
This works, but I'm not sure how to change 'functionname' dynamically, except by passing the xsl through another xsl sheet, and I don't want to do that, I want to set the value with a variable, and set the variable as I call the sheet.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
I think what you're after is the xsl:param, combined with an xsl:call-tempalte or xsl:apply-templates call. For example, I use the following template to remove duplicates from a deeply nested list [/Body/Details/Item/Ref[@Type='Note']/Identifier ]:
<xsl:template name="DeDupe">
<xsl:param name="list" />
<xsl:param name="sep" select="', '" />
<xsl:for-each select="$list">
<xsl:variable name="curr" select="string(.)" />
<xsl:variable name="i" select="position()" />
<xsl:choose>
<xsl:when test="count($list[$i > position() and string(.) = $curr]) > 0" />
<xsl:otherwise>
<xsl:if test="position() != 1"><xsl:copy-of select="$sep" /></xsl:if>
<xsl:value-of select="$curr" />
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
...
<xsl:call-template name="DeDupe">
<xsl:with-param name="list" select="XPath expression" />
</xsl:call-template>
|
|
|
|
|
Sort of - but I hoped to be able to call the stylesheet and pass in the variable, not run another transform to get it.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
So you're looking for something like:
<xsl:template name="ListItems">
<xsl:param name="list" />
<xsl:param name="name" />
<xsl:for-each select="$list[contains(@name, $name)]">
<-- Do something here -->
</xsl:for-each>
</xsl:template>
...
<xsl:call-template name="ListItems">
<xsl:with-param name="list" select="XPath expression" />
<xsl:with-param name="name" select="'M:XMLObject:functionname'" />
</xsl:call-template>
|
|
|
|
|
Christian - use xsl:param as a direct child of the xsl:stylesheet root element. You can then access the parameter in any XPath expression as $param-name.
The parameters can be added using the addParameter of IXSLProcessor if you're accessing MSXML programmatically. If you're using a command-line tool, obviously, it depends, but MSXSL (Microsofts c-line XSL tool) has a "param=value" syntax.
HTH
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Wow - that is EXACTLY what I was looking for, thanks.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Hi,
I am working on a C++ application using MSXML 4.0. I have a update function that need to update a node of the XML document. The function only receives a XML string that contains the new XML string corresponding to the node. How can I copy the XML string into the node?
Thank you.
|
|
|
|
|
Sascha wrote:
How can I copy the XML string into the node?
I did it in my CP+ article.
|
|
|
|
|
If I am not mistaking you are using the .NET Framework. I need to do the same whiteout the framework and use directly the MSXML.dll
|
|
|
|
|
|
How can i make IE 6.0 to validate an xml based on a Schema? Is it possible?
It seems to ignore the xsd file.
rechi
|
|
|
|
|
If I recall correctly, IE does not try to validate XML documents. You need to write a bit of code that sets the DOM's validateOnParse property to true and then loads the XML document into the DOM. Here's a JavaScript sample from the MSXML 4.0 SDK:
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");<br />
xmlDoc.async = false;<br />
xmlDoc.validateOnParse = true;<br />
xmlDoc.load("books.xml");
Erik Westermann
Author, Learn XML In A Weekend (October 2002)
|
|
|
|
|
You're right, IE doesn't validate the xml s. But you're code is missing the XMLSchemaCache part...
Anyway, you still deserve a !
rechi
|
|
|
|
|
Clearly I'm relatively new to authoring xml documents.
If I have an elment eg CarEngineCompnent and this element can have more CarEngineComponent within it, how do I represent this in an XML Schema? I'm confused as to what the schema should look like.
ASP.NET can never fail as working with it is like fitting bras to supermodels - it's one pleasure after the next - David Wulff
|
|
|
|
|
Senkwe Chanda wrote:
how do I represent this in an XML Schema?
...like this:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="CarEngineComponent">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="CarEngineComponent"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
Although technically allowed, having a structure like this undermines one of the the benefits that an XSD (XML Schema) provides, namely, strong types. What this schema essentially says is that a CarEngineComponent is a mixed type element that can contain a value and another element. Although there's noting wrong with that from a purely structural point of view, most XML documents don't use that structure prefering instead ot have elements that contain data or other elements.
A bettter structure could be to have <CarEngineComponents> (note the plural form of the word) that contain one or more <CarEngineComponent> types. The naming convention makes it clear that <CarEngineComponents> is a container for something else.
Erik Westermann
Author, Learn XML In A Weekend (October 2002)
|
|
|
|
|
Thanks Erik. I'm trying to setup a schema for a situation where the level of containment is unknown and/or variable. For example, that CarEngineComponent could have a CarEngineComponent that itself contains another CarEngineComponent.
I'm getting the feeling that perhaps I'm not thinking in an XML-like way (which I've surprisingly found is not as sraight forward as I'd thought)
Thanks again, I'll go and rethink my document.
Regards
Senkwe
ASP.NET can never fail as working with it is like fitting bras to supermodels - it's one pleasure after the next - David Wulff
|
|
|
|