|
<xsl:sort
select="@attribute_name"
order="descending"
data-type="number"
/>
|
|
|
|
|
Hello,
I am trying to load XML document in the browser from a JavaScript variable. The
reason is when I create XML document from a Database I don't want to store it
on a disk and then load from a disk, I just want to pass it to a browser as a
string/variable.
Well, I know how to do it in IE: by using xmlDoc.loadXML method like in example
below
var xmlStr = "<cat><cd><title>Empire<artist>Bob
Dylan<cd><title>Hide<artist>Bonnie";
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.onreadystatechange = tmp;
xmlDoc.loadXML(xmlStr);
function tmp()
{
if (xmlDoc.readyState == 4) generateFromXML();
}
function generateFromXML()
{
// processing code
// ...
}
In Netscape 6 I use:
var xmlStr = "<cat><cd><title>Empire<artist>Bob
Dylan<cd><title>Hide<artist>Bonnie";
xmlDoc = document.implementation.createDocument("", "", null);
xmlDoc.onload = generateFromXML;
xmlDoc.loadXML(xmlStr);
function generateFromXML()
{
// processing code
// ...
}
Well, xmlDoc.loadXML(xmlStr) doesn't work.
Does anybody know how to do the same thing in Netscape 6?
Thanks
Hitesh
|
|
|
|
|
I want an xslt-doc that changes an unknown document where the node foo is known to have the attribute bar. bar should change to "changed", but the remainder of the document should remain the same. the xsl:copy is obvious, but how do I copy all attribs but bar?
|
|
|
|
|
I know this might sound like a stupid question...
If I want simple XML capabilities in my C++ application using the MS XML com objects, what needs to be installed on a default W2K installation?
Must I include the MS XML engine in my installation package, or can I recommend a minimum version of IE to be installed?
thanks,
jeremy
Jeremy Pullicino
Professional C++ Developer
Done any hacking lately?
|
|
|
|
|
Full table here[^].
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
|
i have the following xml document with a default namespace.
<?xml version='1.0' ?>
<ROOT xmlns="mynamespace">
<FIRST>something</FIRST>
<ROOT>
i did all the MSXML4 necessary things to work with the default namespace and got the Xpath expression working with the selectsinglenode() and selectnodes().
now when i create the <SECOND> tag , i get an unwanted empty xmlns attribute in the new tag and its causing all the Xpath expression to break.
<?xml version='1.0' ?>
<ROOT xmlns="mynamespace">
<FIRST>something</FIRST>
<SECOND xmlns="">something</SECOND>
<ROOT>
how do i get rid of this xmlns="" attribute? I tried removeNamdItem("xmlns") but it does not work. how do i prevent the empty xmlns attribute from apprearing?
a workaround i did was to get xmldoc->getxml(), search and replace the xmlns="" but that is not a viable solution.
thanks..
meng
|
|
|
|
|
Have you tried using createNode(NODE_ELEMENT, "SECOND", "mynamespace") to create the element?
|
|
|
|
|
thanks for your advise! solved.
if (GetDefaultNamespace().IsEmpty())
{
// Create element with no namespace
spNewNode = spXmlDoc->createNode(MSXML2::NODE_ELEMENT, _bstr_t(_T("SECOND")), "");
}
else
{
// Create element with default namespace
spNewNode = spXmlDoc->createNode(MSXML2::NODE_ELEMENT, _bstr_t(_T("SECOND")), _bstr_t(_T("mynamespace")));
}
huikm
|
|
|
|
|
Hey,
This must be SO easy to do and must be documented SOMEWHERE but I haven't been able to find out it.
What I want to do is
<tag attr="<tag1>">hey</tag>
But the attr doesn't work. It just doesn't display in HTML when formatted by XSL because it is converted as a tag.
Hope this makes sense
Robbie G
|
|
|
|
|
So, do:
<tag attr="<tag1>">hey</tag>
Shog9
------
And on the pedestal, these words appear:
"My name is Ozymandias, King of Kings,
Look on my Works, ye Mighty, and despair!"
Nothing beside remains.
|
|
|
|
|
How to convert a string with special caracters to
a string correctly read by XML ?
A special function in VC++ ?
Used a MSXML parser function ?
Thanks for your response !
|
|
|
|
|
Yes, MSXML should work, you can use SetText(), etc.
Shog9
------
No one's immune now, from a world of problems
No one's exempt now, from a world of pain
That's the way that it goes
when you're down here with the rest of us...
|
|
|
|
|
I have objects that I want to save to a file (XML format, generated by serialization). I also want the data to be encrypted. Should I encrypt the objects before they are serialized/saved to XML, or should I serialize and then encrypt the whole XML document? Which method is easier/more efficient, and why?
On a side note, where can I find a good, straight-forward tutorial for encryption using .NET (specifically, C#)? Thanks in advance.
|
|
|
|
|
Traditionally its better to encrypt something that has little redundancy, i.e. with little repetition. This is often why text files are compressed before they are encrypted, then decrypted and decompressed at the other end.
It's difficult to suggest something without a little more info about what it is you're trying to encrypt. Do you mean encrypt individual members of a type, like a string field containing a name or something?
For ease its probably better to just encrypt the XML document, if you want to you could always find some .NET code to compress the document beforehand and then encrypt that.
--
Paul
"I need the secure packaging of Jockeys. My boys need a house!"
- Kramer, in "The Chinese Woman" episode of Seinfeld
MS Messenger: paul@oobaloo.co.uk
Sonork: 100.22446
|
|
|
|
|
i introduced a namespace into the XML document and all the Xpath construct did not work. It was working before i introduced the namespace. what is wrong?
<?xml version="1.0" ?>
<ROOT>
<TEST>something 1</TEST>
<TEST>something 2</TEST>
<ROOT>
selectNodes(_bstr_t(_T("//TEST")); // working
with namespace
<?xml version="1.0" ?>
<ROOT xmlns="http://www.mynamespace.com">
<TEST>something 1</TEST>
<TEST>something 2</TEST>
<ROOT>
selectNodes(_bstr_t(_T("//TEST")); // error
i added the namespace cos i am doing xml schema validation using MSXML4 which turned out to be ok.
but with the xmlns..., all the xpath expressions failed.
This is my first encountered with namespace in xml document
appreciate any help advise. thanks
meng
|
|
|
|
|
|
what is the equivalent for NamespaceManager for VC++?
|
|
|
|
|
IMXNamespaceManager , i think... that said, i've no idea how to use it.
However, take a look at this:
reallylongmslink/xml2nd_pro_v4_0tyr.asp[^]
Shog9
------
And on the pedestal, these words appear:
"My name is Ozymandias, King of Kings,
Look on my Works, ye Mighty, and despair!"
Nothing beside remains.
|
|
|
|
|
I'd like to generate an XSL using ASP3.0
I've already written the code to make the XSL, but when loading it in to another ASP-page so that it can style a XML, I get the following error:
msxml3.dll error '80004005'
The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document.
This while the beginning of the XSL-page clearly makes a root-element:
<%
Response.ContentType = "text/xml"
Response.Expires = 0
Set result = Server.CreateObject("Microsoft.XMLDOM")
%>
<?xml version="1.0" encoding="ISO-8859-1"?>
<%
'// add a node to the result tree for the stylesheet declaration
Set oNewNode = result.createNode("element","xsl:stylesheet", "http://www.w3.org/1999/XSL/Transform")
oNewNode.setAttribute "version","1.0"
oNewNode.setAttribute "xmlns:xsl","http://www.w3.org/1999/XSL/Transform"
result.appendChild(oNewNode)
'// the stylesheet declaration is the outermost grouping tag. It is the root
'// element and parent to all other elements
Set root = result.documentElement
...
What might be a sollution to fix this?
|
|
|
|
|
Why do you want to do this ? Why not generate it with XSL ?
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
|
|
|
|
|
What encoding is typically used with XML when embeded binary data?
Todd Smith
|
|
|
|
|
|
I have a xml file which has to be sent to another system with the node name changed.
eg:
"<emp name="me" id = "30">"
has to changed to
"<employee name="me" id = "30">"
This is a bulk operation where performance is critical. The platform is vb6.0/vb.NET. Can any one help me out
dsk
|
|
|
|
|
dsk wrote:
This is a bulk operation where performance is critical
Honestly I would not even use XSL for this. The change is so simple that just a string-replace function would be best. With XSL you would have far more overhead.
Even RegEx would probably be a better choice.
|
|
|
|