|
Thanks for the help and example. What I want to do is set up a configuration file (similar to the Cars example) that resembles a C++ data structure, and work with that in both C++ and HTML.
On the HTML side, I'm considering an XML approach so that (IF POSSIBLE) I could easily display the structure in HTML-Help, a Help utility/application for VC++ generated applications.
Thanks again,
Johnny
|
|
|
|
|
Sorry for reposting but I had some info screwed up.
Using MSSXL....
After transforming an XML using an XSL I get stuff like this around the resulting text:
<br />
< ? xml version="1.0" encoding="UTF-16" ? ><br />
plus tag attributes like these:
<br />
xmlns:msxsl="urn:schemas-microsoft-com:xslt"<br />
xmlns:us="us"<br />
in elements that are on top level template match.
What are these? How to disable?
Thanks a lot!
|
|
|
|
|
If you're wanting to output text from an XSL, use the XSL output tag, with the method attribute set to 'text'.
If you're outputting XML - you **need** the XML processing instruction to make your output be XML!!!! You can, however, get rid of namespace declarations you don't want by using the exclude-result-prefixes on the stylesheet/transform elements.
HTH
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Using MSSXL....
After transforming an XML using an XSL I get stuff like this around the resulting text:
<br />
<?xml version="1.0" encoding="UTF-16"?><br />
plus tag attributes like these:
<br />
xmlns:msxsl="urn:schemas-microsoft-com:xslt"<br />
xmlns:us="us"<br />
in elements that are on top level template match.
What are these? How to disable?
Thanks a lot!
|
|
|
|
|
Hello, I am using Xerces DOM for C++ in my application. Is there a way to initialize a skeletal DOM object based upon a schema? The Xerces documentation says no to DTD, so I am assuming that transfers over to schemas. Does anyone know if MSXML supports it or any other tool? I was wondering if a tool like XMLSpy will generate a skeletal XML file from a *.xsd schema file? Any help is appreciated -
|
|
|
|
|
XMLSpy will - see my previous answer[^]
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
I have this xml file:
<?xml version="1.0" standalone="yes"?>
<xs:schema xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="Store3">
<xs:element name="Store3" msdata:IsDataSet="true" msdata:Locale="en-CA">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Associates">
<xs:complexType>
<xs:sequence>
<xs:element name="AssociateId" type="xs:int"/>
<xs:element name="LASTNAME">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="FIRSTNAME">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//Associates"/>
<xs:field xpath="AssociateId"/>
</xs:unique>
</xs:element>
</xs:schema>
How can i get this one?
<xs:element name="Associates">
<xs:complexType>
<xs:sequence>
<xs:element name="AssociateId" type="xs:int"/>
<xs:element name="LASTNAME">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="FIRSTNAME">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
thanx in advance
|
|
|
|
|
Hi, i have this file :
===================
<xs:schema xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="Store3">
<xs:element name="Store3" msdata:isdataset="true" msdata:locale="en-CA">
<xs:complextype>
<xs:choice maxoccurs="unbounded">
<xs:element name="Associates">
<xs:complextype>
<xs:sequence>
<xs:element name="AssociateId" type="xs:int">
<xs:element name="LASTNAME">
<xs:simpletype>
<xs:restriction base="xs:string">
<xs:maxlength value="50">
<xs:element name="FIRSTNAME">
<xs:simpletype>
<xs:restriction base="xs:string">
<xs:maxlength value="50">
<xs:unique name="Constraint1" msdata:primarykey="true">
<xs:selector xpath=".//Associates">
<xs:field xpath="AssociateId">
===================
So how can i just get this one?
<xs:element name="Associates">
<xs:complextype>
<xs:sequence>
<xs:element name="AssociateId" type="xs:int">
<xs:element name="LASTNAME">
<xs:simpletype>
<xs:restriction base="xs:string">
<xs:maxlength value="50">
<xs:element name="FIRSTNAME">
<xs:simpletype>
<xs:restriction base="xs:string">
<xs:maxlength value="50">
thanx in advance
|
|
|
|
|
Hi there,
On the project I'm currently busy I have the following issue:
We are receiving SOAP 1.1 messages (according to SOAP 1.1 schema) and need to output messages conforming to a schema in another namespace. The structure of both schema's are identical as you can see below.
SOAP schema instance:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<SomeHeader/>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<SomeElement/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Output message schema instance:
<BLA:Envelope xmlns:BLA="http://SomeOtherNamespace">
<BLA:Header>
<SomeHeader/>
</BLA:Header>
<BLA:Body>
<SomeElement/>
</BLA:Body>
</BLA:Envelope>
Okay here the challenge:
We're in need for a high performance transformation of these two messages. The way we would love to see it is having the transform implemented completly streaming.
- input stream read when output stream is being readon (pull).
- low memory footprint.
Environment: C# on .NET platform.
Options I'm considering:
1. Implementing a streaming namespace replacing XML text reader.
A stream is read by a custom XMLTextReader that replaces the xml namespace declaration so the message is implicetly converted.
The problem with this solution is that the streaming XML text reader does not provide a way to generate an output stream. Using the XMLTextWriter object and WriteNode method reads the entire message and puts out the message to the underlying stream. But this is push technology and the process is blocked until the reading and writing is done.
2. Using streaming XSLT (pull)
I have not been able to get this to work. Anybody can give me a hand?
3. Am I overlooking something? Please let me know.
Kind regards for your patience and hopefully a good solution.
Bas
|
|
|
|
|
hello all,
I need to create a XML document say "input.xml" from a XmlSchemaDefinition(input.xsd) document. Kindly tell me how to go about it?
any pointer wud be of utmost help,
thnks
|
|
|
|
|
Downlaod a trial version of XMLSpy[^] - that can generate XML instance documents from XSDs and DTDs.
Make sure it's a trial of the Enterprise or Professional version - the other version doesn't do it.
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Ok, I know I will get reamed for this XML-newbie question, but here is what I want to know.
Can I have this
<br />
<dataItem_00><br />
<name>somename</name><br />
<type>sometype</type><br />
<br />
<dataItem_01><br />
<name>sub_name_1</name><br />
<type>sub_type_1</type><br />
<dataItem_01><br />
<br />
<dataItem_01><br />
<name>sub_name_2</name><br />
<type>sub_type_2</type><br />
<dataItem_01><br />
</dataItem_00><br />
Basically, I am uncertain about the reuse of tags within nested "blocks"
Thanks,
Johnny
|
|
|
|
|
using dataItem__xx is stupid, but what you're doing is totally legal, that's how you'd have a list of items all the same, which have subitems.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I am gong to nit pic here.
reusing tags is not a problem.
Properly terminating the blocks is and the sample you show does not.
None of your dataItem_01 elements (you have 4 as shown not 2) are terminated.
I do not mind getting old. It beats all the other options that can think of.
|
|
|
|
|
hi sudheer,
is it .NET? If yes, look on System.Xml namespace, expecially classes System.Xml.XmlTextReader or System.Xml.XmlDocument on MSDN.com, there are lot of exmaples how to read XML files.
If it's not .NET, what is it?
best regards,
David 'DNH' Nohejl
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
Hai,
i want to retrive the xml data, i have one xml file, that file contain some data. i want retrive the that data. please givethe procedure how to retrive?
thanks
sudheer
|
|
|
|
|
Hi,
I need an application which displays a tee view of an XML document.
I have seen many applications which do the same. But I need to draw the Tree with the element text and with out attributes node in the tree.
Let me make it clear..
Here is snippet of the xml file.
--------------------------------------------------------------------------------
- <device name="TenGiPHY" deviceversion="1.0.0.1" productid="24622.10.0.1" fileversion="1.0.2.2">
- <group name="PMA/PMD">
- <folder name="MDIO">
- <register name="PMACTR1" length="16" address="0x10000" resetval="0x2040" access="rw">
<longname>PMA Control Register 1
<value>0x0
- <element name="RES" offset="15" length="1">
<longname>PMA reset
<desc>This bit remains set (1) while reset is in progress and is cleared (0) automatically as soon as reset is completed. The first MDIO access following an MDIO reset must be an address frame. Access to this bit affects the entire device.
<modified>false
<state text="Normal operation" value="0x0">
<state text="All registers within the TenGiPHY-L are set to their initial state." value="0x1">
----------------------------------------------------------------------------------------
The tree I need is
TenGiPHY
|
|_PMA/PMD
| |
| |_MDIO
| | |_PMACTR1
| |_NextFolderName
|
|_Next group name
and so on..
But I have the least idea to do this.
Could anyone help me?
Thank you,
|
|
|
|
|
Sorry, some lines are missing..
I am giving the xml lines here again..
<!DOCTYPE device (View Source for full doctype...)>
- <device name="TenGiPHY" deviceversion="1.0.0.1" productid="24622.10.0.1" fileversion="1.0.2.2">
- <group name="PMA/PMD">
- <folder name="MDIO">
- <register name="PMACTR1" length="16" address="0x10000" resetval="0x2040" access="rw">
<longname>PMA Control Register 1</longname>
<value>0x0</value>
- <element name="RES" offset="15" length="1">
<longname>PMA reset</longname>
<desc>This bit remains set (1) while reset is in progress and is cleared (0) automatically as soon as reset is completed. The first MDIO access following an MDIO reset must be an address frame. Access to this bit affects the entire device.</desc>
<modified>false</modified>
<state text="Normal operation" value="0x0" />
<state text="All registers within the TenGiPHY-L are set to their initial state." value="0x1" />
</element>
|
|
|
|
|
what is the requirements needed to host the xml web service i mean if the hosting dosn't support .NET framework can i publish the web service on it or no, please help me
|
|
|
|
|
Has anyone else had any issues with the Dataset.SaveXML method??
I have found that with this xml file
<database xmlns="http://tempuri.org/Database.xsd">
<DBTable>
<name>vwAppointment</name>
<selectall>false</selectall>
<selectbykey>false</selectbykey>
<update>true</update>
<insert>true</insert>
<delete>false</delete>
<DBFields>
<name>pkId</name>
<primarykey>false</primarykey>
<datatype>int</datatype>
<nullable>false</nullable>
<length>4</length>
<precision>10</precision>
<selectby>-1</selectby>
<updateby>false</updateby>
<deleteby>false</deleteby>
</DBFields>
<DBFields>
<name>AppointmentType</name>
<primarykey>false</primarykey>
<datatype>varchar</datatype>
<nullable>false</nullable>
<length>30</length>
<precision>30</precision>
<selectby>-1</selectby>
<updateby>false</updateby>
<deleteby>false</deleteby>
</DBFields>
</DBTable>
</database>
and this xslt
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:for-each select="database/DBTable/name">
<<xsl:value-of select="*"/>Table>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
The transform does not work, however if i remove this attribute
xmlns="http://tempuri.org/Database.xsd"
the transform will work (well work to some extent with my dodgy xpath queries).
Why does this happen? how can i get around this? is there an xslt setting i need to change?
Thanks for your help
Pete
|
|
|
|
|
Hi there.
I have an SQL XML template residing on a web server which takes a parameter (japanese characters) and calls a stored proc.
If I hard code the japanese parameter into the XML file, I can execute the stored proc and have records returned.
However, the XML template is called from an ASP page, also on the web server, using the ("Msxml2.ServerXMLHTTP.4.0") object. I call the template using the following code:
-------------------------------------------------------------------------
Set SearchObj = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
templateURL = "http://localhost/xmldir/xmltemplate/global_search.xml"
Param = "?PRIM_NAME=" & JAPANESE_NAME
SearchObj.open "GET", templateURL & Param, False
SearchObj.send
-------------------------------------------------------------------------
Variable 'JAPANESE_NAME' is a company name in japanese (ie. double byte).
Every other instance of double byte characters are handled fine by my ASP and XML, however it is only when I am trying to send some double byte characters as arguments to this template that it fails.
I have also tried passing the japanese data to the XML template manually via a URL call....but it also fails.
My XML template looks like this:
----------------------------------------------------------
<root xmlns:sql="urn:schemas-microsoft-com:xml-sql" sql:xsl="global_search.xsl">
<sql:header>
<sql:param name="PRIM_NAME">
<sql:query>
exec my_stored_proc @PRIM_NAME
----------------------------------------------------------
I can run the stored proc through query analyzer and give it some japanese characters as arguments and it works fine.
Can SQL XML templates handle double byte data passed as a parameter or does it have to be hard coded in the file?
Any help would be appreciated
|
|
|
|
|
Greetings,
I have a xsl file which transforms my xml file into a html page, and when I use it as a style sheet for my xml data it works fine. But when I use XslTransform called from a c# application it doesn't transform the file correctly it replaces my java script "<" symbol with "<" symbol.
I have this code in a "
|
|
|
|
|
hi,
replace "<" with "<;". Yes, in JS. It will render/transform (?) correctly for browser. Than it should be fine. Also, you should (or even must, I am not sure) call XslTransform constructor that take XmlResolver as a parametr. (I don't know if it's really needed bt other constructors are obsolete )
best regards,
David 'DNH' Nohejl
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
Thanks for the reply,
It still didn't work, it just left the &.l.t.; (kept formating it as <) in the javascript code. I saw a code blurb where they suggested commenting out the "<![CDATA" section with // so it won't resolve that.
At any rate here is a snippet of the code I am trying to do.
------------------------------------------------------------
<?xml version='1.0'?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
<HTML>
<BODY>
<SCRIPT type="text/javascript">
//<![CDATA[
function test()
{
// Note, in this example the < has "." between them to keep the formating, since the forum kept reformating it as "<"
for(int index=0;index&.l.t.;10;index++)
{
... Do something here.
}
}
//]]>;
</SCRIPT>
...
...
It doesn't make any sense why this isn't working.
|
|
|
|
|
hi,
belive me, it works maybe remove <![CDATA]> ?I am working on something similar and it is working!
here is (simplified) my code:
<br />
<script language="JavaScript"><br />
function ShowSelect(o)<br />
{ <br />
var x2 = document.getElementsByTagName('div');<br />
for(i=0;i<x2.length;i++)<br />
{<br />
<br />
}<br />
}<br />
</script><br />
</head><br />
<body><br />
<br />
try<br />
{<br />
XslTransform xt = new XslTransform();<br />
xt.Load(StylesheetURL);<br />
xt.Transform(SourceURL,ResultURL,new XmlUrlResolver());<br />
}<br />
catch(Exception ex)<br />
{<br />
<br />
throw;<br />
}<br />
What I missed? This is definitely working in my app. I can't send you my original code cuz my boss wouldn't be happy about it
David
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|