|
How to display xml transformed in HTML in a windows Application?
|
|
|
|
|
using XSL ...
Your question is way too general, so I'll recommend that perhaps you get yourself a good XML book (i.e., Teach yourself XML in 24 hours).
As for displaying HTML in a windows Application, you'll need to make use of the IBrowser/IBrowser2 interface.
D.
|
|
|
|
|
|
Hi ,
I am creating xml document from dataset.
one of my data field is of data type datetime.
so when I am converting it to xml it is getting conveted in to long date value ,but i don't want long date.
for example
my datetime field value is 8/29/2002
and it is getting converted into '2002-08-29T00:00:00.0000000+05:30'
I hope I have explained my problem to some extent.
can anybody help me out to solve this problem?
thanks
|
|
|
|
|
I ran into this same "issue", and I ended up just storing the Date as a string in the XML and then converting it back into a Date/Time when I read the data back in ...
There's probably a more "direct" approach to take, but this works just fine.
D.
|
|
|
|
|
I have very little idea about XML and i want to learn this thing. Can some one suggest link, good book to learn
1-XML basics and what it is.
2-Good way to learn MSXML API.
Thanks
paracha3
|
|
|
|
|
|
Jump in over your head... try O'Reilly's XSLT Cookbook.
|
|
|
|
|
Oops... sorry, I mis-read your post and thought you were looking for XSL resources.
|
|
|
|
|
Hi...
I have createds a XML document (chart.xml) along with a seperate XML Schema (chart.xsd) document to describe the structure of the XML document and its data types.
My confusion comes in (after trying the w3CSchools explanation unsuccessfully) when namespaces need to be applied.
All I want to do is get the XML document to reference this XSD document (which are located in the same folder) so that value and elements within the XML document are of the correct format (this is what schema is for is it not?).
Also how can I tell its working properly?
Any help/pointers would be very appreicated.
Ta
John
XML CODE----------------------------------------
<chartdata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
="" xsi:nonamespaceschemalocation="file:chart.xsd">
<chart name="ttt">
<data_xaxis>
<dataitem>Mon
<dataitem>Tue
<dataitem>Wed
<dataitem>Thu
<dataitem>Fri
<dataitem>Sat
<dataitem>Sun
<data_yaxis>
<dataitem>45
<dataitem>50
<dataitem>30
<dataitem>10
<dataitem>30
<dataitem>50
<dataitem>70
<totalsizex>600
<totalsizey>400
<legend_xaxis>Days of the month
<legend_yaxis>Total man hours
<chart_title>Daily Studio man hours
<xmargin>50
<ymargin>50
<plotstart_leftx>30
<plotstart_topy>20
Schema CODE-------------------------------------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<xs:element name="CHART">
<xs:complextype>
<xs:sequence>
<xs:attribute name="name"
="" type="xs:string" use="required">
<xs:element name="DATA_XAXIS">
<xs:complextype>
<xs:sequence>
<xs:element name="DATAITEM"
="" type="xs:string" minoccurs="0" maxoccurs="unbounded">
<xs:element name="DATA_YAXIS">
<xs:complextype>
<xs:sequence>
<xs:element name="DATAITEM"
="" type="xs:string" minoccurs="0" maxoccurs="unbounded">
<xs:element name="TOTALSIZEX" type="xs:integer">
<xs:element name="TOTALSIZEY" type="xs:integer">
<xs:element name="LEGEND_XAXIS" type="xs:string">
<xs:element name="LEGEND_YAXIS" type="xs:string">
<xs:element name="CHART_TITLE" type="xs:string">
<xs:element name="XMARGIN" type="xs:integer">
<xs:element name="YMARGIN" type="xs:integer">
<xs:element name="PLOTSTART_LEFTX" type="xs:integer">
<xs:element name="PLOTSTART_TOPY" type="xs:integer">
|
|
|
|
|
--XML CODE------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<CHARTDATA xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="file:chart.xsd">
<CHART NAME="ttt">
<DATA_XAXIS>
<DATAITEM>Mon</DATAITEM>
<DATAITEM>Tue</DATAITEM>
<DATAITEM>Wed</DATAITEM>
<DATAITEM>Thu</DATAITEM>
<DATAITEM>Fri</DATAITEM>
<DATAITEM>Sat</DATAITEM>
<DATAITEM>Sun</DATAITEM>
</DATA_XAXIS>
<DATA_YAXIS>
<DATAITEM>45</DATAITEM>
<DATAITEM>50</DATAITEM>
<DATAITEM>30</DATAITEM>
<DATAITEM>10</DATAITEM>
<DATAITEM>30</DATAITEM>
<DATAITEM>50</DATAITEM>
<DATAITEM>70</DATAITEM>
</DATA_YAXIS>
<TOTALSIZEX>600</TOTALSIZEX>
<TOTALSIZEY>400</TOTALSIZEY>
<LEGEND_XAXIS>Days of the month</LEGEND_XAXIS>
<LEGEND_YAXIS>Total man hours</LEGEND_YAXIS>
<CHART_TITLE>Daily Studio man hours</CHART_TITLE>
<XMARGIN>50</XMARGIN>
<YMARGIN>50</YMARGIN>
<PLOTSTART_LEFTX>30</PLOTSTART_LEFTX>
<PLOTSTART_TOPY>20</PLOTSTART_TOPY>
</CHART>
</CHARTDATA>
--XSD CODE------------------------------------------------
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<xs:element name="CHART">
<xs:complexType>
<xs:sequence>
<xs:attribute name="name"
type="xs:string"
use="required" />
<xs:element name="DATA_XAXIS">
<xs:complexType>
<xs:sequence>
<xs:element name="DATAITEM"
type="xs:string"
minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DATA_YAXIS">
<xs:complexType>
<xs:sequence>
<xs:element name="DATAITEM"
type="xs:string"
minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TOTALSIZEX" type="xs:integer" />
<xs:element name="TOTALSIZEY" type="xs:integer" />
<xs:element name="LEGEND_XAXIS" type="xs:string" />
<xs:element name="LEGEND_YAXIS" type="xs:string" />
<xs:element name="CHART_TITLE" type="xs:string" />
<xs:element name="XMARGIN" type="xs:integer" />
<xs:element name="YMARGIN" type="xs:integer" />
<xs:element name="PLOTSTART_LEFTX" type="xs:integer" />
<xs:element name="PLOTSTART_TOPY" type="xs:integer" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
|
|
|
|
|
Namespaces are used to qualify elements and attributes. They aren't necessary, but are usually a good idea so that you can easily qualify elements and attributes when using XML documents with mixed content. To use them, add the xs:targetNamespace (where xs is the namespace prefix for XMLSchemas) and then use the same namespace to qualify your XML document that you gave first. To use it as the default namespace, use xmlns="....." with no prefix.
When you're using code to access the DOM, you can use any prefix you want, so long as the namespace in the namespace manager (in .NET, this is the XmlNamespaceManager ) matches (case-sensitively) the namespace declared in the document.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
- IXMLDOMDocument2Ptr ObjXMLDoc;
- hresult = ObjXMLDoc.CreateInstance("Msxml2.DOMDocument.4.0");
i then perform the following call:
- ObjXMLDoc->load(Filename);
where Filename is a valid XML file (no scheme is used).
this call takes out memory resources, and when i use the same last call with a different Filename, it takes more of it - without releasing the last one's resources.
is there a way to "Unload" an xml file from memory (to perform something like the opposite of "load" method)?
|
|
|
|
|
To my knowledge, the only way to free the memory used is to release the object containing the held memory. Try the .Release method on the smart pointer to free the pointer, but not the reference. Because *Ptr's are smart pointers (_com_ptr_t), don't get this method mixed up with the ->Release method. If that does not work, try a master/worker approach with one main reference on the object and subsequent QIs on it for "worker" references.
HTH,
Ryan
|
|
|
|
|
i tried to free the memory using .Release method - it did release it, but the memory is still not released.
i tried working with only one reference to the object, but it still used more resources on every call to the .load method.
i also tried using
::CoFreeUnusedLibraries();
::CoUninitialize();
at the end of the function which does all that.
still - the memory is not released.
|
|
|
|
|
The only other thing I can think of it that you are probably running in Debug mode. Debug mode has lots of extra features to help protect running code (Buffering around data structures, holding references, etc). Do you see the problem running in Release mode?
|
|
|
|
|
it's not the debug mode.
i was trying to perform .Release() on the XML IXMLDOMDocument2Ptr object at different places in the code - in order to search for the place that keeps the resources unreleased after that method call.
i found that the method released the resources, until i used a function call, to my own function which one of its parameters is from type IXMLDOMNodePtr.
i could see that a new reference to the object was added, but i wasn't able to release the resources after this function all, even by using "= NULL" on the object in this function plus the original one that was sent.
am i not releasing the object as i should?
can't i send a smart pointer as a parameter to my own function and get rid of the object afterwards (not the object - it's cought resources - the object itself becomes NULL)?
|
|
|
|
|
hi all :
I want to make a solution that have 3 projects ,1-web app 2-win app 3-mobile app , iwant to use asp.net web services to link between them all ,the win app is connected to a local DB server(sql server) ,and connect to the internet 1 time per day,and the web app is connected to a remote DB server (sql server) ,and also the mobile app.
the questions are :
1- how can i use Asp.net web services well to make the solution works well?
2-How can i manage the DB ?and how can i make daily transaction to update the remote server with the new data at the local server?? or what??
3-how can i use the same methods for dealing with the DB ,for the win app , the web app and the mobile app?
hadada
MCDBA, MCSD, MSAD
|
|
|
|
|
I'm using an XML file to hold a bunch of links, each of these links also have a category assigned to them.
Here is an example:
<br />
- <links><br />
<linkNum>57 <br />
<linkType>Business Links <br />
<linkName>Clark County Services <br />
<linkURL>http:
I use this .asp script that loads an XML file with an XSL file.
The beauty of this ASP file was that you could pass the name of the XSL file, and it would load it. Now what I would like to do, is just have 1 xsl file, and use the .asp file to transform only a certain template in the .xsl file. (There would be several different teplates in there...)
Is this possible?
Below is the .asp file I'm using...
<br />
sub dispXML(toCall)<br />
'------ Find out which XSL file needs to be called ------------<br />
<br />
styleFile = Server.MapPath(toCall)<br />
<br />
'------ DISPLAY THE XML DATA ------------<br />
' Linking XML and XSL together<br />
sourceFile = Server.MapPath("linkList.xml")<br />
set source = Server.CreateObject("Microsoft.XMLDOM")<br />
source.async = false<br />
source.load(sourceFile)<br />
set style = Server.CreateObject("Microsoft.XMLDOM")<br />
style.async = false<br />
style.load(styleFile)<br />
Response.Write source.transformNode(style)<br />
<br />
end sub<br />
Any help would be great. Thanks.
|
|
|
|
|
yes use xsl:param
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
ah - yes.
My only problem has been passing something TO an XSL file?
Any ideas? Ideally, I'd call it from a .asp file...
|
|
|
|
|
I have seen this done using xsl:param directly under the xsl:stylesheet declaration to pass in parameters, but I have only seen this work with command-line processors like Saxon, Xalan. Unfortunately, MSXML does not support top-level parameters.
The workaround would be to append the data you want to pass through a parameter in the XML to be transformed and read it into a top-level variable.
|
|
|
|
|
I use Embedded Visual C++ 3.0 (evc) to develop for PocketPC 2002 (PPC).
I plan to do XSLT on PPC.
My plan is to read an XML- and XSL-file and transform the XML-file to HTML with XSLT.
Does anybody know if that is possible on PPC?
Are there any SDKs, librarys, tools or samples?
thx, Daniel
|
|
|
|
|
Ok, I'll keep this as simple as possible. I need to Query an XML file and Return the "DataRow" Nodes that meet some criteria contained in more than one ChildNode of the Row. Keep in mind that I cannot simply make the ID's part of the "DataRow" node, because for every XML file, the IDs are totally different Columns (not by my design).
Here's an example XML data:
<DataTable>
<DataRow>
<DataColumn Name="DatabaseID" Value="1" />
<DataColumn Name="RowID" Value="1" />
</DataRow>
</DataTable>
Ok, what I need to do is Select all "DataRow" nodes where the "DataColumn" matches the following criteria:
@Name='DatabaseID' and @Value='1' and @Name='RowID' and @Value='1'
Here's what I have so far, but I can't seem to match a DataRow to multiple criteria in the DataColumns:
//DataRow/DataColumn[@Name='DatabaseID' and @Value='1']
|
|
|
|
|
//DataRow[ DataColumn/@Name='DatabaseID' and DataColumn/@Value='1' and DataColumn/@Name='RowID' and DataColumn/@Value='1']
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|