.NETGURU
trasformNode still
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngxml' list.


renevazquez@cimex.com.cu

Hi, I have a domDocument that I want to transform. I obtain the
domdocument by doing an Xpath selection: "tempXmlDom =
xmlDomData.selectSingleNode('//diffgr:diffgram/dsPart');" and the
transformation returns an empty xml.

then I copy the xml that is inside the tempXmlDom object after the
Xpath selection and put it in a xml file on the disc, then I change
the way of doing things and load the xml from the file (wich is
identical to the one in the object filled using the Xpath method):
"xmlDom.load("test.xml")" and then transform the domdocument and the
transformation worked.

Why if the domdocument obtained from the method have the same xml that
the domdocument obtained from the file, the last works and the first
not???

thanks a lot to any help!

Reply to this message...
 
    
Tim Curtin
use the 'innerText' property of the node.
x = tempXMLDom.innerText

[Original message clipped]

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com

Reply to this message...
 
    
Kirk Allen Evans
Since you are using namespaces, you will need to set the SelectionNamespaces
property of the DOM prior to using a namespace in an XPath query:

Here is the example from the MSXML 4.0 SDK:

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
var objNodeList;
xmlDoc.async = false;
xmlDoc.load("hello.xsl");
xmlDoc.setProperty("SelectionNamespaces",
"xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");
xmlDoc.setProperty("SelectionLanguage", "XPath");
objNodeList = xmlDoc.documentElement.selectNodes("//xsl:template");
alert(objNodeList.length);

Modify this example so that the SelectionNamespaces property properly binds
the "diffgr" prefix to the appropriate namespace.

However, note that GENERALLY the use of "//" is a bad idea. There are
several articles on MSDN regarding MSXML and performance: the use of "//"
is one of the top performance problems related to developing with MSXML.
This syntax literally tells the processor to search the entire document
recursively for a node called "diffgram" bound to the namespace bound to the
"diffgr" prefix, that contains a child node "dsPart". The problem here is
the "search the entire document recursively" part: if you already know the
path to a node, then specify it: otherwise, you are introducing very
inefficient match patterns.

"/diffgr:diffgram/dsPart"

This solution, indicated as "[A]", indicates that the parser should start
from the root of the document, and the "diffgr:diffgram" will be the
document element node, containing a child dsPart. This is much more
efficient that using "//".

"diffgr:diffgram/dsPart"

This query, indicated as "[B]", tells the parser to perform the query
relative to the current node. So, if you use:

xmlDoc.selectNodes("diffgr:diffgram/dsPart")

This is essentially the same thing as [A]. However, you can use this syntax
with the selectSingleNode or selectNodes method of an IXMLDOMNode object to
get the relative child of the current node.

Kirk Allen Evans
http://www.xmlandasp.net
"XML and ASP.NET", New Riders Publishing
http://www.amazon.com/exec/obidos/ASIN/073571200X

Reply to this message...
 
    
renevazquez@cimex.com.cu
Kirk, thanks a lot once more! for all the tips

But my doubt is because when I view the xml from the object filled
with the xpath selection operation with a alert box in ie it is
exactly what I want after the selection. If the xpath operation
woudn't have been succesfull I woudn't view the correct xml right?

The problem is that when I transform this object I get an empty result,
and when I load the same xml from a file I get the transformed xml that I want.

I tested what you said by setting the property Selection Namespace and
the result is still empty.

______________________________ Reply Separator _________________________________
Subject: [aspngxml] RE: trasformNode still
Author: "aspngxml" <Click here to reveal e-mail address> at INTERNET-MAIL
Date: 19/07/2002 14:40

Since you are using namespaces, you will need to set the SelectionNamespaces
property of the DOM prior to using a namespace in an XPath query:

Here is the example from the MSXML 4.0 SDK:

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
var objNodeList;
xmlDoc.async = false;
xmlDoc.load("hello.xsl");
xmlDoc.setProperty("SelectionNamespaces",
"xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");
xmlDoc.setProperty("SelectionLanguage", "XPath");
objNodeList = xmlDoc.documentElement.selectNodes("//xsl:template");
alert(objNodeList.length);

Modify this example so that the SelectionNamespaces property properly binds
the "diffgr" prefix to the appropriate namespace.

However, note that GENERALLY the use of "//" is a bad idea. There are
several articles on MSDN regarding MSXML and performance: the use of "//"
is one of the top performance problems related to developing with MSXML.
This syntax literally tells the processor to search the entire document
recursively for a node called "diffgram" bound to the namespace bound to the
"diffgr" prefix, that contains a child node "dsPart". The problem here is
the "search the entire document recursively" part: if you already know the
path to a node, then specify it: otherwise, you are introducing very
inefficient match patterns.

"/diffgr:diffgram/dsPart"

This solution, indicated as "[A]", indicates that the parser should start
from the root of the document, and the "diffgr:diffgram" will be the
document element node, containing a child dsPart. This is much more
efficient that using "//".

"diffgr:diffgram/dsPart"

This query, indicated as "[B]", tells the parser to perform the query
relative to the current node. So, if you use:

xmlDoc.selectNodes("diffgr:diffgram/dsPart")

This is essentially the same thing as [A]. However, you can use this syntax
with the selectSingleNode or selectNodes method of an IXMLDOMNode object to
get the relative child of the current node.

Kirk Allen Evans
http://www.xmlandasp.net
"XML and ASP.NET", New Riders Publishing
http://www.amazon.com/exec/obidos/ASIN/073571200X

| [aspngxml] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngxml.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
renevazquez@cimex.com.cu

what for do I have to use the innerText=3F
=20
what I am trying to say is that apparently the xml inside the dom =

object is what I want when I view it with alert (tempXML=2Exml=29=2C=
but in=20
fact is not because when transformed it doesn't output what I want=
=2E In=20
other words if the dom really have the xml that I view why it does=
n't=20
transform=2C or is diferent the xml that I view using the alert bo=
x that=20
the real one inside the dom=3F

=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F Reply Separator _=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F
Subject=3A [aspngxml=5D Re=3A trasformNode still=20
Author=3A "aspngxml=22 <aspngxml=40aspfriends=2Ecom=3E at INTERNET-MAI=
L
Date=3A 19=2F07=2F2002 14=3A40

use the 'innerText' property of the node=2E=20
x =3D tempXMLDom=2EinnerText
=20
=20
=3EFrom=3A renevazquez=40cimex=2Ecom=2Ecu
=3EReply-To=3A "aspngxml=22 <aspngxml=40aspfriends=2Ecom=3E=20
=3ETo=3A "aspngxml=22 <aspngxml=40aspfriends=2Ecom=3E=20
=3ESubject=3A [aspngxml=5D trasformNode still
=3EDate=3A Fri=2C 19 Jul 2002 12=3A39=3A31 -0400=20
=3E
=3E
=3E Hi=2C I have a domDocument that I want to transform=2E I obtai=
n the=20
=3E domdocument by doing an Xpath selection=3A "tempXmlDom =3D
=3E xmlDomData=2EselectSingleNode=28'=2F=2Fdiffgr=3Adiffgram=2FdsP=
art'=29=3B=22 and the=20
=3E transformation returns an empty xml=2E
=3E
=3E then I copy the xml that is inside the tempXmlDom object after=
the=20
=3E Xpath selection and put it in a xml file on the disc=2C then I=
change=20
=3E the way of doing things and load the xml from the file (wich i=
s
=3E identical to the one in the object filled using the Xpath meth=
od=29=3A
=3E "xmlDom=2Eload=28=22test=2Exml=22=29=22 and then transform the=
domdocument and the=20
=3E transformation worked=2E
=3E
=3E Why if the domdocument obtained from the method have the same =
xml=20
=3Ethat
=3E the domdocument obtained from the file=2C the last works and t=
he first=20
=3E not=3F=3F=3F
=3E
=3E thanks a lot to any help!
=3E
=3E
=3E| [aspngxml=5D member tjctek=40hotmail=2Ecom =3D YOUR ID
=3E| http=3A=2F=2Fwww=2Easplists=2Ecom=2Fasplists=2Faspngxml=2Easp =3D =
JOIN=2FQUIT=20
=3E| http=3A=2F=2Fwww=2Easplists=2Ecom=2Fsearch =3D SEARCH Archives
=20
=20
=20
=20
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=20
Join the world=92s largest e-mail service with MSN Hotmail=2E=20
http=3A=2F=2Fwww=2Ehotmail=2Ecom
=20
=20
| [aspngxml=5D member renevazquez=40cimex=2Ecom=2Ecu =3D YOUR ID
| http=3A=2F=2Fwww=2Easplists=2Ecom=2Fasplists=2Faspngxml=2Easp =3D JOI=
N=2FQUIT=20
| http=3A=2F=2Fwww=2Easplists=2Ecom=2Fsearch =3D SEARCH Archives
=20
=20
=

Reply to this message...
 
    
Kirk Allen Evans
It really sounds like the namespace is not present in the XSLT stylesheet.
To solve this, you don't have to add the SelectionNamespaces property to the
DOM, but you do need to add it to the XSLT. For instance, if you have the
diffgr namespace prefix bound to the
"urn:schemas-microsoft-com:xml-diffgram-v1" namespace, then you should use
that namespace in your XSLT as well.

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
.
.
.
</xsl:stylesheet>

Anytime that you reference a node from within your XSLT that belongs to the
diffgram namespace, you simply prefix it with the "diffgr" namespace prefix.

There are several tools available to help debug XSLT transformations. For
instance, Microsoft offers the XSL Debugger [1] as well as MSXSL.EXE [2]. A
more professional product is Xselerator [3] by Marrowsoft, which allows you
to step through XSLT stylesheets. Another great tool (if you are developing
for .NET) is Visual XSLT by ActiveState [4]. I would highly recommend you
ensure that your XSLT is actually working first, THEN try to debug the code
that is performing the transformation.

Kirk Allen Evans
http://www.xmlandasp.net
"XML and ASP.NET", New Riders Publishing
http://www.amazon.com/exec/obidos/ASIN/073571200X

[1]
http://msdn.microsoft.com/downloads/samples/internet/default.asp?url=/Downlo
ads/samples/Internet/xml/xsl_debugger/Default.asp
[2]
http://msdn.microsoft.com/downloads/sample.asp?url=/msdn-files/027/001/485/m
sdncompositedoc.xml&frame=true
[3] http://www.topxml.com/xselerator
[4] http://activestate.com/Products/Visual_XSLT/

[Original message clipped]

Reply to this message...
 
    
renevazquez@cimex.com.cu

why when I load the same xml from a file it transforms ok=3F

=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F Reply Separator _=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F
Subject=3A [aspngxml=5D RE=3A trasformNode still=20
Author=3A "aspngxml=22 <aspngxml=40aspfriends=2Ecom=3E at INTERNET-MAI=
L
Date=3A 19=2F07=2F2002 20=3A39

It really sounds like the namespace is not present in the XSLT styleshe=
et=2E=20
To solve this=2C you don't have to add the SelectionNamespaces property=
to the=20
DOM=2C but you do need to add it to the XSLT=2E For instance=2C if you=
have the=20
diffgr namespace prefix bound to the=20
=22urn=3Aschemas-microsoft-com=3Axml-diffgram-v1=22 namespace=2C then y=
ou should use=20
that namespace in your XSLT as well=2E
=20
=3Cxsl=3Astylesheet version=3D=221=2E0=22
xmlns=3Axsl=3D=22http=3A=2F=2Fwww=2Ew3=2Eorg=2F1999=2FXSL=2FTra=
nsform=22=20
xmlns=3Adiffgr=3D=22urn=3Aschemas-microsoft-com=3Axml-diffgram-=
v1=22=3E
=2E
=2E
=2E
=3C=2Fxsl=3Astylesheet=3E
=20
Anytime that you reference a node from within your XSLT that belongs to=
the=20
diffgram namespace=2C you simply prefix it with the "diffgr=22 namespac=
e prefix=2E
=20
There are several tools available to help debug XSLT transformations=2E=
For=20
instance=2C Microsoft offers the XSL Debugger [1=5D as well as MSXSL=2E=
EXE [2=5D=2E A=20
more professional product is Xselerator [3=5D by Marrowsoft=2C which al=
lows you=20
to step through XSLT stylesheets=2E Another great tool (if you are dev=
eloping=20
for .NET=29 is Visual XSLT by ActiveState [4=5D=2E I would highly reco=
mmend you=20
ensure that your XSLT is actually working first=2C THEN try to debug th=
e code=20
that is performing the transformation=2E
=20
=20
Kirk Allen Evans
http=3A=2F=2Fwww=2Exmlandasp=2Enet
=22XML and ASP=2ENET=22=2C New Riders Publishing=20
http=3A=2F=2Fwww=2Eamazon=2Ecom=2Fexec=2Fobidos=2FASIN=2F073571200X
=20
=20
=5B1=5D
http=3A=2F=2Fmsdn=2Emicrosoft=2Ecom=2Fdownloads=2Fsamples=2Finternet=2F=
default=2Easp=3Furl=3D=2FDownlo=20
ads=2Fsamples=2FInternet=2Fxml=2Fxsl=5Fdebugger=2FDefault=2Easp
=5B2=5D
http=3A=2F=2Fmsdn=2Emicrosoft=2Ecom=2Fdownloads=2Fsample=2Easp=3Furl=3D=
=2Fmsdn-files=2F027=2F001=2F485=2Fm=20
sdncompositedoc=2Exml&frame=3Dtrue
=5B3=5D http=3A=2F=2Fwww=2Etopxml=2Ecom=2Fxselerator
=5B4=5D http=3A=2F=2Factivestate=2Ecom=2FProducts=2FVisual=5FXSLT=2F
=20
=3E -----Original Message-----
=3E From=3A renevazquez=40cimex=2Ecom=2Ecu [mailto=3Arenevazquez=40cime=
x=2Ecom=2Ecu=5D=20
=3E Sent=3A Friday=2C July 19=2C 2002 4=3A09 PM
=3E To=3A aspngxml
=3E Subject=3A [aspngxml=5D RE=3A trasformNode still=20
=3E
=3E
=3E Kirk=2C thanks a lot once more! for all the tips=20
=3E
=3E But my doubt is because when I view the xml from the object fi=
lled=20
=3E with the xpath selection operation with a alert box in ie it i=
s
=3E exactly what I want after the selection=2E If the xpath operat=
ion
=3E woudn't have been succesfull I woudn't view the correct xml ri=
ght=3F=20
=3E
=3E The problem is that when I transform this object I get an=20=
=0A=3E empty result=2C
=3E and when I load the same xml from a file I get the transformed=20
=3E xml that I want=2E
=3E
=3E I tested what you said by setting the property Selection=20=
=0A=3E Namespace and
=3E the result is still empty=2E
=3E
=3E
=3E _=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F Reply Separator=20
=3E _=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F
=3E Subject=3A [aspngxml=5D RE=3A trasformNode still
=3E Author=3A "aspngxml=22 <aspngxml=40aspfriends=2Ecom=3E at INTERNET=
-MAIL=20
=3E Date=3A 19=2F07=2F2002 14=3A40
=3E
=3E
=3E Since you are using namespaces=2C you will need to set the=20
=3E SelectionNamespaces
=3E property of the DOM prior to using a namespace in an XPath query=3A=
=20
=3E
=3E Here is the example from the MSXML 4=2E0 SDK=3A=20
=3E
=3E var xmlDoc =3D new ActiveXObject=28=22Msxml2=2EDOMDocument=2E4=2E0=22=
=29=3B=20
=3E var objNodeList=3B
=3E xmlDoc=2Easync =3D false=3B
=3E xmlDoc=2Eload=28=22hello=2Exsl=22=29=3B
=3E xmlDoc=2EsetProperty=28=22SelectionNamespaces=22=2C
=3E "xmlns=3Axsl=3D'http=3A=2F=2Fwww=2Ew3=2Eorg=2F1999=2FXSL=2FTransfor=
m'=22=29=3B=20
=3E xmlDoc=2EsetProperty=28=22SelectionLanguage=22=2C "XPath=22=29=3B
=3E objNodeList =3D xmlDoc=2EdocumentElement=2EselectNodes=28=22=2F=2Fx=
sl=3Atemplate=22=29=3B=20
=3E alert=28objNodeList=2Elength=29=3B
=3E
=3E Modify this example so that the SelectionNamespaces property=20
=3E properly binds
=3E the "diffgr=22 prefix to the appropriate namespace=2E=20
=3E
=3E However=2C note that GENERALLY the use of "=2F=2F=22 is a bad idea=2E=
There are=20
=3E several articles on MSDN regarding MSXML and performance=3A the
=3E use of "=2F=2F=22
=3E is one of the top performance problems related to developing with M=
SXML=2E=20
=3E This syntax literally tells the processor to search the entire docu=
ment=20
=3E recursively for a node called "diffgram=22 bound to the namespace
=3E bound to the
=3E "diffgr=22 prefix=2C that contains a child node "dsPart=22=2E The =

=3E problem here is
=3E the "search the entire document recursively=22 part=3A if you=20
=3E already know the
=3E path to a node=2C then specify it=3A otherwise=2C you are introduci=
ng very=20
=3E inefficient match patterns=2E
=3E
=3E "=2Fdiffgr=3Adiffgram=2FdsPart=22
=3E
=3E This solution=2C indicated as "=5BA=5D=22=2C indicates that the par=
ser should start=20
=3E from the root of the document=2C and the "diffgr=3Adiffgram=22 will=
be the
=3E document element node=2C containing a child dsPart=2E This is much=
more=20
=3E efficient that using "=2F=2F=22=2E
=3E
=3E "diffgr=3Adiffgram=2FdsPart=22
=3E
=3E This query=2C indicated as "=5BB=5D=22=2C tells the parser to perfo=
rm the query=20
=3E relative to the current node=2E So=2C if you use=3A
=3E
=3E xmlDoc=2EselectNodes=28=22diffgr=3Adiffgram=2FdsPart=22=29=20
=3E
=3E This is essentially the same thing as [A=5D=2E However=2C you can =
use=20
=3E this syntax
=3E with the selectSingleNode or selectNodes method of an IXMLDOMNode=20=
=0A=3E object to
=3E get the relative child of the current node=2E=20
=3E
=3E
=3E Kirk Allen Evans
=3E http=3A=2F=2Fwww=2Exmlandasp=2Enet
=3E "XML and ASP=2ENET=22=2C New Riders Publishing
=3E http=3A=2F=2Fwww=2Eamazon=2Ecom=2Fexec=2Fobidos=2FASIN=2F073571200X=
=20
=3E
=3E
=3E | [aspngxml=5D member renevazquez=40cimex=2Ecom=2Ecu =3D YOUR ID
=3E | http=3A=2F=2Fwww=2Easplists=2Ecom=2Fasplists=2Faspngxml=2Easp =3D=
JOIN=2FQUIT=20
=3E | http=3A=2F=2Fwww=2Easplists=2Ecom=2Fsearch =3D SEARCH Archives
=3E
=3E
=3E
=3E
=3E | [aspngxml=5D member kaevans=40xmlandasp=2Enet =3D YOUR ID
=3E | http=3A=2F=2Fwww=2Easplists=2Ecom=2Fasplists=2Faspngxml=2Easp =3D=
JOIN=2FQUIT=20
=3E | http=3A=2F=2Fwww=2Easplists=2Ecom=2Fsearch =3D SEARCH Archives
=3E
=3E
=3E
=20
=20
| [aspngxml=5D member renevazquez=40cimex=2Ecom=2Ecu =3D YOUR ID
| http=3A=2F=2Fwww=2Easplists=2Ecom=2Fasplists=2Faspngxml=2Easp =3D JOI=
N=2FQUIT=20
| http=3A=2F=2Fwww=2Easplists=2Ecom=2Fsearch =3D SEARCH Archives
=20
=20
=

Reply to this message...
 
    
Kirk Allen Evans
[Original message clipped]

Again, post your code. Obviously something is being done differently if you
can get it to work one way and not another. I have guessed at the problem
up until this point, but it would be a lot easier to troubleshoot if you
could post your example up. You will need to include at minimum:

The code that loads the XML
The code that loads the stylesheet
The code that performs the transformation
The XML source
The XSLT source

Kirk Allen Evans
http://www.xmlandasp.net
"XML and ASP.NET", New Riders Publishing
http://www.amazon.com/exec/obidos/ASIN/073571200X

Reply to this message...
 
    
renevazquez@cimex.com.cu
this is the xml that returns my webservice:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";><soap:Body><ReturnXMLResp
onse xmlns="http://tempuri.org/";><ReturnXMLResult><xs:schema
id="dsPart" targetNamespace="http://tempuri.org/dsPart.xsd";
xmlns:mstns="http://tempuri.org/dsPart.xsd";
xmlns="http://tempuri.org/dsPart.xsd";
xmlns:xs="http://www.w3.org/2001/XMLSchema";
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified"
elementFormDefault="qualified"><xs:element name="dsPart"
msdata:IsDataSet="true"><xs:complexType><xs:choice
maxOccurs="unbounded"><xs:element
name="Part"><xs:complexType><xs:sequence><xs:element name="partNo"
type="xs:string"/><xs:element name="descr"
type="xs:string"/><xs:element name="price"
type="xs:decimal"/><xs:element name="ret"
type="xs:boolean"/><xs:element name="sentaiCode"
type="xs:string"/></xs:sequence></xs:complexType></xs:element></xs:cho
ice></xs:complexType><xs:unique name="partNo"><xs:selector
xpath=".//mstns:Part"/><xs:field
xpath="mstns:partNo"/></xs:unique></xs:element></xs:schema>

<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">

<dsPart xmlns="http://tempuri.org/dsPart.xsd";> <Part diffgr:id="Part1"
msdata:rowOrder="0"><partNo>x1</partNo><descr>memoria
Ram</descr><price>60</price><ret>false</ret><sentaiCode>123</sentaiCod
e></Part>

<Part diffgr:id="Part2"
msdata:rowOrder="1"><partNo>x2</partNo><descr>Procesador</descr><price
[Original message clipped]


and this are the functions that manipulate it:

function openWebService()
{

htcWebService.useService("../RMAapp_WebService/Test.asmx?WSDL",
"Test");
loadXml();
}

function loadXml()
{
document.all('lblStatus').innerHTML = 'Cargando Datos,
por favor espere...';
iCallID = htcWebService.Test.callService(xmlLoaded,
"ReturnXML");
}

function xmlLoaded(objResult)
{
if (objResult.error)
{
var strErrorCode =
objResult.errorDetail.code;
var strErrorMsg =
objResult.errorDetail.string;
var strErrorRaw =
objResult.errorDetail.raw;

document.all('lblStatus').innerHTML =
'<b>* ERROR:</b> ' + 'could not load data.<br />' + strErrorCode;
}
else
{
document.all('lblStatus').innerHTML =
'Loading data from<br />Web Service - please wait ...';

xmlDomData = new
ActiveXObject('MSXML2.FreeThreadedDOMDocument');

xmlDomData.onreadystatechange = change; xmlDomData.async = false;
xmlDomData.validateOnParse = true;
xmlDomData.loadXML(objResult.raw.xml);

var partXsl = '<?xml version="1.0"
?><xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:ns="http://tempuri.org/dsPart.xsd";
exclude-result-prefixes="ns"><xsl:output method="xml"
encoding="UTF-8"/><xsl:template match="/ns:dsPart
"><dsPart><xsl:for-each
select="ns:Part"><Part><partLnk>javascript:go("<xsl:value-of
select="ns:partNo"/>")</partLnk><partNo><xsl:value-of
select="ns:partNo"/></partNo><descr><xsl:value-of
select="ns:descr"/></descr></Part></xsl:for-each></dsPart></xsl:templa
te></xsl:s tylesheet>';

var xslDom = new
ActiveXObject('MSXML2.FreeThreadedDOMDocument');
var xmlDom = new
ActiveXObject('MSXML2.FreeThreadedDOMDocument');

var xmlDomTarget = new
ActiveXObject('MSXML2.FreeThreadedDOMDocument');

var tempXmlDom = new
ActiveXObject('MSXML2.FreeThreadedDOMDocument');

xslDom.async = false;
xslDom.loadXML(partXsl);

tempXmlDom.async = false;
tempXmlDom.validateOnParse = true;
tempXmlDom =
xmlDomData.selectSingleNode('//diffgr:diffgram/dsPart');

xmlDom.async = false;
xmlDom.load("test.xml");

alert (tempXmlDom.text );
alert (xmlDom.xml);

xmlDomTarget.async = false;

xmlDom.transformNodeToObject(xslDom,xmlDomTarget);

dsoPart.XMLDocument.loadXML(xmlDomTarget.xml);

document.all('test').value =
xmlDomData.xml;
alert (dsoPart.XMLDocument.xml);
}
}

______________________________ Reply Separator
_________________________________
Subject: [aspngxml] RE: trasformNode still
Author: "aspngxml" <Click here to reveal e-mail address> at INTERNET-MAIL
Date: 21/07/2002 20:28

[Original message clipped]

Again, post your code. Obviously something is being done differently
if you can get it to work one way and not another. I have guessed at
the problem up until this point, but it would be a lot easier to
troubleshoot if you could post your example up. You will need to
include at minimum:

The code that loads the XML
The code that loads the stylesheet
The code that performs the transformation The XML source
The XSLT source

Kirk Allen Evans
http://www.xmlandasp.net
"XML and ASP.NET", New Riders Publishing
http://www.amazon.com/exec/obidos/ASIN/073571200X

| [aspngxml] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngxml.asp = JOIN/QUIT |
http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
renevazquez@cimex.com.cu
Hi Kirk, the problem is solved!!! thanks a lot for all your support,
as you said it was all about the namespaces. I thinked that I copied
the exact xml but the xml in the file had one namespace that do not
have the xml in the dom, well thanks again! and I hope that everthing
goes ok from now on, see you..

______________________________ Reply Separator _________________________________
Subject: [aspngxml] RE: trasformNode still
Author: "aspngxml" <Click here to reveal e-mail address> at INTERNET-MAIL
Date: 21/07/2002 20:28

[Original message clipped]

Again, post your code. Obviously something is being done differently if you
can get it to work one way and not another. I have guessed at the problem
up until this point, but it would be a lot easier to troubleshoot if you
could post your example up. You will need to include at minimum:

The code that loads the XML
The code that loads the stylesheet
The code that performs the transformation
The XML source
The XSLT source

Kirk Allen Evans
http://www.xmlandasp.net
"XML and ASP.NET", New Riders Publishing
http://www.amazon.com/exec/obidos/ASIN/073571200X

| [aspngxml] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngxml.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
 
System.Web.Services.WebService




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification