|
Friend;
One of my young/just out of college co-worker use XML to holder information in record, instead of using database fields like normal.
for ex:
In an Order table he would use a short table with only OrderId and OrderXML columns
where in field OrderXML he keep a long XML which hold all OrderDate, QTY, Price,etc..)
His argument is this will make application scalable, but this really cause me a greate concern that his application will be un-scalable since he can not use all the feature DB, SQL provides. And he has to handcode every steps.
I heard XML is for data interchange but never hear XML is for data processing
You have more experiences with XML than me. Please advise if he is ok
Thanks
|
|
|
|
|
Mixing what is meant by scalable.
In the OrderXML field, you can extend the contents without redefining the database. So it scales.
As you point out XML is not a DB. So the ability to query and sort is limited and potentially very time consuming. Yes new versions promise support for XQuery and queries into xml enteries but this is hardly proven IMhO. And I am very much a XML evangelist.
All the standard fields to support your orders I would have as db fields. With extensible data that I do not need to search on, in the OrderXML.
XML is for data interchange and support data reformating very well, which I would call data processing but not in the sense you state.
my 2 cents.
I do not mind getting old. It beats all the other options that I can think of.
|
|
|
|
|
Hey
At the moment im busy with a document collaboration that would be in essence making use of xml documents in the same way. Yeah, its kinda jump doing so, but if it can be perfected (when i say perfected i mean efficient reporting, etc.) it would definitely be the next step in efficient document collaboration. Dodgy, yes, but it forms part of my research as well. Could you do me a fav & get your friend to maybe send me a mail, Id like to know how the implementation of the system went/is going?
Cheers
|
|
|
|
|
Hello friends,
i want to create an XML document through VB6.This document is to be imported in TALLY.
please do help me
pallavi
|
|
|
|
|
Hi people,
ich have two xsl files to convert a xml file to a pdf and to a html.
the question is:
is there any way, that i put this two xsl files in one whole xsl file. which can be configured to convert the xml file to a pdf or a html. maybe a variable in xsl file or something like that..
--------- This one is for conveting to pdf ---------------------
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><br />
<br />
<xsl:template match="/tagebuch"><br />
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"><br />
...<br />
</fo:root> <br />
</xsl:template> <br />
</xsl:stylesheet>
----------------------------------------------------------------
--------- This one is for conveting to html ---------------------
<xsl:stylesheet version="1.0" <br />
xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><br />
<br />
<br />
<xsl:template match="/"><br />
<html><body><head><title>Tagebuch</title></head><br />
...<br />
</body></html><br />
</xsl:template><br />
</xsl:stylesheet>
-----------------------------------------------------------------
I would be very happy for a tip or a help..
thanx in advance
|
|
|
|
|
Maybe you could use the xsl:param element (
http://www.w3schools.com/xsl/el_param.asp).
<xsl:param name = "outputType"/>
Then you can put the two stylesheets in a choose structure (http://www.w3schools.com/xsl/el_choose.asp)
<xsl:choose>
<xsl:when test = "$outputType = 'PDF'">
... PDF template ...
</xsl:when>
<xsl:otherwise>
... HTML template ...
</xsl:otherwise>
</xsl:choose>
Haven't tried it, but you may need to modify your XSL. I suspect you cannot put an xsl:template inside an xsl:choose structure.
|
|
|
|
|
hi there , may i know are there any full examples for ebxml ... removeobjectrequest , adhocquery , updateobjectrequest and submitobjectrequest
thanks ...
|
|
|
|
|
I want to merge two xml files using dom parser in C++ using xerces library.
and also to compare one xml file with the xsd file using all with dom parser.
eg:
merge:
<root>
satheesh
<tm>bhaskar
<pl>siddesh
<pl>prashanth
i have to merge a xml file which is
<pl>siddesh
<pe>chary
<pe>sandy
to the above xml file
and out put should be
<root>
satheesh
<tm>bhaskar
<pl>siddesh
<pe>chary
<pe>sandy
<pl>prashanth
and also how to compare one xml file with xsd file using dom in c++.
with regards
Chary
|
|
|
|
|
Any recomendations on a standalone app to test wsdl's. On line would not be acceptable.
I am having an problem with creating a web reference based on a WSDL created by an axis server. The MS supplied wsdl.exe crashs (out of stack space) when I try to create the client code. Both command line and in visual studio.
I run the saved file and or the url through everything I have (other than WSDL.exe) and no compliants. My tools are the current version of SoapScope, Stylus Studio 5.0, Cape Clears SOA editor and some general purpose xml display tools I created.
I do not mind getting old. It beats all the other options that I can think of.
|
|
|
|
|
I'm attempting to validate some xml and absolutely stumped. However, the code always says it fails.
I'm using the note example from the w3schools.com xml tutorial and using the validator linked
to on their website it says everything is good.
The string coming into the doValidation function is the xml file, as a flat string no linebreaks or carriage returns.
Any thoughts/ideas would be great!
<br />
private bool doValidation( string note )<br />
{<br />
_isValid=true;<br />
<br />
StringReader srXml = new StringReader( note );<br />
<br />
XmlValidatingReader vr;<br />
XmlTextReader tr;<br />
XmlSchemaCollection schemaCol = new XmlSchemaCollection();<br />
schemaCol.Add( "http://www.w3schools.com", "c:\\note.xsd" );<br />
<br />
try <br />
{<br />
tr = new XmlTextReader( srXml );<br />
vr = new XmlValidatingReader( tr );<br />
<br />
vr.ValidationType = ValidationType.Schema;<br />
vr.Schemas.Add( schemaCol );<br />
vr.ValidationEventHandler += new ValidationEventHandler(validationCallBack);<br />
<br />
while( vr.Read() )<br />
{}<br />
}<br />
catch( Exception e )<br />
{<br />
this._errorMessage = e.Message;<br />
return false;<br />
}<br />
<br />
return _isValid;<br />
}<br />
<br />
private void validationCallBack( object sender, ValidationEventArgs args )<br />
{<br />
_isValid = false;<br />
_errorMessage = args.Message;<br />
}<br />
|
|
|
|
|
Hi everyone,
I want to learn web services from A to Z, how to write web services, how to call them, how to let other user (on other machine of course)use them. what protocols I need to understand in order to write web services...
If you can give me some links to articles or tutorials to begin understanding the web services technologies.
also if u can give me some book titles discussing web services.
Thanks.
|
|
|
|
|
Goodway wrote:
I want to learn web services from A to Z
Rather a large request.
Ok, Start with tcp/ip and general web communications. There are some articles here on CP to get you started.
Next understand that a web service is the process of sending and optionally recieving a SOAP message sent with the above protocals.
SOAP is just an XML message that is compliant with the SOAP specification.
When you get that down. you can think about what style of service you want. RPC for exposing existing capability as a service or new development doc/litteral (wsdl first)
I hope you get the understanding to know it a-z is not trival. You do not have to know it all to get started.
Just get C# or vb project setup (look over cp, many good articles, some of the better ones are from Roman Kiss, and of course Chris M. also.)
Get your feet wet. Then study what you really have created. I suggest finding a tcp/ip trace tool so you can see what you really sent over the wires.
Good luck.
I do not mind getting old. It beats all the other options that I can think of.
|
|
|
|
|
whats wrong in this xml:
<?xml version='1.0' encoding='utf-8'?>
<root xmlns=''>
<data xmlns=''>
<name>ahmed galal</name>
<name>tamer galal</name>
</data>
</root>
if nothin wrong then why everytime i try to use XmlDocument.Load() it throws an System.Xml.XmlException with message "Root element is missing"
any help ?
|
|
|
|
|
I have no idea. But from the top of my head, try remove empty namespaces.
David
|
|
|
|
|
thanx for ur reply, i think i found the clue, but its not about namespaces
at the begin i was reading the xml data from a stream using XmlDocument.Load() and thats why i had the problem, but finally i tried to read the stream into a string then i use XmlDocument.LoadXml() instead and thats worked fine, but i still don't know why i can't read from the stream directly while XmlDocument.Load() function supports that.
anyway thanx
|
|
|
|
|
hmm I don't know but it could be some encoding issue.. was that xml file really UTF-8 encoded? I mean, try to open it in notepad and re-save with UTF-8 encoding. (assuming you have notepad in WinXP or similar which allows that. VS can do it too IIRC)
David
|
|
|
|
|
actually its not a xml file, its just generated xml send through XmlHttp from the client to the server, and i also don't know about the UTF-8 i just choosed any encoding.
|
|
|
|
|
I'm trying to write a C++ (MFC) program that updates an XML file. I originally just wanted to write my C++ program to deal with the code itself, but then I started updating it to work with special cases and the code got messy. I was told to use an XML parser and since MSXML appears to be already installed on my computer I decided to go with that. The problem is, all the tutorials I found are confusing because they include a lot of unnecessary tasks that would be useful for programs that work with XML files extensively but not for mine. The fact that oftentimes they just show the whole code and say what its final result is doesn't help much either.
I figured out how to create a parser instance and open up a file, but that's as far as I got. My program just needs to update some settings for some tags. For example if the xml file is something like:
<first Value="0"><br />
...<br />
</first><br />
...<br />
<second Value="1"><br />
<subsecond OtherValue="0"><br />
...<br />
</subsecond><br />
<subsecond OtherValue="0"><br />
...<br />
</subsecond><br />
<subsecond OtherValue="0"><br />
...<br />
</subsecond><br />
</second>
I just need to get it to look for all isntance of that "first" tag and change its "Value" to 2, then for all instances of "second" tag I need to change it's "Value" to say 3, and also inside every "second" tag I would need to change "OtherValue" setting just for the second occurance of "subsecond" and not for any others. So that the output would end up being something like:
<first Value="2"><br />
...<br />
</first><br />
...<br />
<second Value="3"><br />
<subsecond OtherValue="0"><br />
...<br />
</subsecond><br />
<subsecond OtherValue="1"><br />
...<br />
</subsecond><br />
<subsecond OtherValue="0"><br />
...<br />
</subsecond><br />
</second>
Any help or a link to a tutorial that would actually cause more good than harm would be greatly appreciated, thanks.
|
|
|
|
|
Sorry, the formatting got rid of my XML examples. Here they are again, this is the original:
<first Value="0">
...
</first>
...
<second Value="1">
<subsecond OtherValue="0">
...
</subsecond>
<subsecond OtherValue="0">
...
</subsecond>
<subsecond OtherValue="0">
...
</subsecond>
</second>
And the wanted result is:
<first Value="2">
...
</first>
...
<second Value="3">
<subsecond OtherValue="0">
...
</subsecond>
<subsecond OtherValue="1">
...
</subsecond>
<subsecond OtherValue="0">
...
</subsecond>
</second>
Also, please note that the nodes are not necessarily in
<node Value="#">...</node> format, they could also come in <node Value="#" /> format and the second node might come without childnodes, in which case it's second childnode won't be modified (since it doesn't have one).
|
|
|
|
|
Hello:
I am trying to contract an empty tag (with attributes) to the short XML form.
For example:
[current] <col width="100"></col>
[desired] <col width="100"/>
My current XSLT template, outputs beginning <col> and end </col> tags:
<xsl:for-each select="colspec">
<col>
<xsl:for-each select="@*">
<xsl:choose>
<xsl:when test="(name() = 'colwidth') or (name() = 'colsep') or (name() = 'colname') or (name() = 'colnum')">
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:if test="@colwidth"><xsl:attribute name="width"><xsl:value-of select="@colwidth"/></xsl:attribute></xsl:if>
<xsl:apply-templates/>
</col>
</xsl:for-each>
I am wondering how to collapse the end tag when the element is actually empty. Any insight would be greatly appreciated.
Lyteck
|
|
|
|
|
Can't you just create a new element (empty) (<xsl:element name="col" /> ) when you find that the one in your document is empty?
~Javier Lozano
|
|
|
|
|
Hello, I couldn't use your suggestion as the col element has attributes (which need to be added while in some kind of ... "loop").
What I ended up doing is recreate the desired syntax using text output and disable-output-escaping.
<xsl:text disable-output-escaping="yes"><col
<xsl:for-each select="@*">
...
<xsl:text disable-output-escaping="yes">/>
Thanks Javier for the suggestion.
Lyteck Lynhiavu
100 Broadway Ave
New York, NY 10005
|
|
|
|
|
can anybody help me solve why this is happening? I get this exception when tryin to use a custom rendered control from XSLT.
<code>Base Exception: Cannot widen from target type to primitive type.</code>
This is caused when I apply:
<code>
<xsl:element name="ImageControl" namespace="Custom">
<xsl:attribute name="ImageStream">
<xsl:value-of select="imgfn:GetImageByAvatarID(AvatarID)"/> <-- THIS LINE IN PARTICULAR!!!
</xsl:attribute>
</xsl:element>
</code>
the XSLT Extension object (below) IS correctly loaded because i can execute my control without any problem if it is within the ASPX page itself and configured declaritively using control.ImageStream = helper.GetImageByAvatarID(x) ect.
<code>
public System.IO.Stream GetImageByAvatarID(int avatarid)
{
DataRow dr = images.Tables[0].Rows.Find(avatarid);
System.IO.MemoryStream ms = new System.IO.MemoryStream();
foreach(Byte b in (Byte[])dr["avatar"])
{
ms.WriteByte(b);
}
ms.Position = 0;
return ms;
}
</code>
code to init the transform
<code>
public string ExecuteTransform(DataSet ds, string ThreadID)
{
DataSet dsImages = new DataSet();
DataLayer dlAvatarImages = new DataLayer("csp_avatars", DataLayerCommandType.StoredProc);
dlAvatarImages.Parameterize("@thread", ThreadID);
dsImages = dlAvatarImages.Query("avatars");
//xslt transform on post data
XmlDocument xdoc = new XmlDocument();
XslTransform xsl = new XslTransform();
StreamReader sr = new StreamReader(new MemoryStream());
xdoc.LoadXml(ds.GetXml());
//transform attributes
XsltArgumentList xList = new XsltArgumentList();
XsltDateTransform fnDate = new XsltDateTransform();
XsltAvatarGrabber fnAvatar = new XsltAvatarGrabber(dsImages);
//extension objects
xList.AddExtensionObject("urn:datetransform", fnDate);
xList.AddExtensionObject("urn:images", fnAvatar);
xsl.Load(HttpContext.Current.Server.MapPath("")+"\\ForumThread.xslt");
xsl.Transform(xdoc, xList, sr.BaseStream, null);
//reset the underlying stream
sr.BaseStream.Position = 0;
return sr.ReadToEnd();
}
</code>
Any input would be appreciated as I am completely stuck on this one.
|
|
|
|
|
Hi,
I'm pretty much a newbie to xsd's in general, and have a case in a schema I'm designing that I'm not sure how to solve. Basically I have a situation like this:
<parenttype>
<category>Standard</category>
<standardcategorynodes>
<a/>
<b/>
</standardcategorynodes>
</parenttype>
<parenttype>
<category>Special</category>
<specialcategorynodes>
<c>
<d/>
<c/>
</specialcategorynodes>
</parenttype>
where the parent node type is the same, but depending on the value of the category node, subsequent nodes are different. I thought a good solution would be to have a xs:choice, where each choice has a fixed value for the category node and then the relevant subsequent nodes follow but I get a Unique Particle Attribution violation as both choices have the category node. Is there a solution for this type of situation or will i have to workaround it somehow?
Thanks very much, Matt
|
|
|
|
|
I have Xml File like the follwing :
<b><Students xmlns="http://tempuri.org/DemoFile.xsd">
<Student>
<RegNO>1220200054</RegNO>
<Name>Chetan Ranpariya</Name>
<Dept>IT</Dept>
<City>Ahmedabad</City>
</Student>
</Students>
and I had a .xsd file for that in which I set the datatype for
"RegNo" as "long" and set it as a primary key column.
Now problem is when ever I tried to ented text data int RegNo the error is given. It's Ok. But if I enter duplicate value in RegNo field then it does not give any error and accepts data.
So how can I make primary to work like in sql, and access.
Can any one help me?
Thanks in advance for help.
Chetan Ranpariya
|
|
|
|