|
Hi there, I am very new to the new technologies (.NET and XML etc) because my work as a developer at this company does not allow for further training.....
My question, I work alot with databases (access mostly).... how will XML make my life better? I have read in MSDN about it a bit, but would like to know the exact uses etc, because I am getting confused by what other people tell me.
Thanks
|
|
|
|
|
There was a discussion about this in this earlier thread.
Basically what's nifty about XML is the fact that it is plain text, making it very generic. The basic XML concept is very simple, and it has a great many uses.
|
|
|
|
|
As far as uses go you have to open your mind a little. One that is very attractive to me is being able to integrate data in a more data driven nature. Take a look at the Apache Cocoon framework for a sample of what I mean by this.
To be conscious that you are ignorant of the facts is a great step towards Knowledge. Benjamin Disraeli
|
|
|
|
|
XML is awesome for several reasons.
Number one is that it is standard. This is the prime reason XML should be considered for anything at all.
Next, it is rigid, and fails with a parse error if it is not. This strongly encourages clean files, and helps with performance, among other things.
Another thing is XSL. Any standard XML document could be transformed into any sort of file with this powerful technology. Raw ASCII, HTML, DHTML, perhaps even things like postscript and CSS.
The XmlDOM and XPath. This lets any program work with XML in a standardized way. Most programs I make with Xml support use the Dom extensivly.
|
|
|
|
|
XML, the downside:
-XML is a lot slower when searched, compared with normal database queries.
-XML adds a lot of overhead, means bigger DB
-XML parsers are usually slow
-.NET implementation of XML is REALLY SLOW and requires managed code, which sucks hard
XML, the upside:
-universal
-simple tree structure: even a child can read it
-can be created/edited with NOTEPAD, the best application ever written
////////////////////////////////////////////////////////////////////
// NOW THE UPSIDE THAT YOU WERE ASKING ABOUT
//
// you can put in a single DB cell a complex and dinamic structure!
// That means that the information saved in the DB can have a dinamic structure WITHOUT changing the DB!!
////////////////////////////////////////////////////////////////////
|
|
|
|
|
Miguel Lopes wrote:
-XML adds a lot of overhead, means bigger DB
Have you ever zipped/compressed an XML file?
Man, I grinned from ear to ear when I saw the compression ratio. Zip loves all those repetitive tags.
So for transfer it is not as big a problem as some people make out. Of course when you are working with the XML it has to be unzipped and then the size can be a pain.
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
The greatest thing you'll ever learn is just to love, and to be loved in return - Moulin Rouge
Alison Pentland wrote:
I now have an image of you in front of the mirror in the morning, wearing your knickers, socks and shoes trying to decided if they match!
|
|
|
|
|
The problem is when you are working with a speed-demanding DB system, when the client workstations need almost real time feedback from the DB. If i want to conduct a search inside each XML string (if you treat it as a stream) for each row in a DB table, and you also have to unzip it first, the overall system performance is heavly reduced.
For transfers, no problem. I agree with you.
Best Regards
|
|
|
|
|
Hello;
I want to update my XML file by XSXML40. But i have no idea how can i do that. The main problem is, i don't want to save (or write) whole file after update a record.
How can i update a record in XML file (I don't want to use DOM).
Thank you...
Ahmet Orkun GEDiK
|
|
|
|
|
SAX.
Alice thought that running very fast for a long time would get you to somewhere else. " A very slow kind of country!" said the queen. "Now, here , you see, it takes all the running you can do, to keep in the same place".
|
|
|
|
|
how do we display the selected value in select box(drop down) in xsl & xml. All the values for drop down are selected thru' xml file.
|
|
|
|
|
Just to be clear: do you want to use XML/XSL to do something to your select boxes in response to a client-side event?
|
|
|
|
|
yes. I want to use XML/XSL for onChange javascript event.
|
|
|
|
|
You don't really need XSL for client-side processing (unless you want a client-side event to write a lot of HTML). XSL is a transformation language, not a programming language. It can be used to write HTML elements, but doesn't respond to them.
Is this for an intranet application, or an internet application? (I.e. can you control which browser your users have?) What exactly should happen in the SELECT element's onChange event?
|
|
|
|
|
Is this for browser-based client side?
If so, why not do the following:
when event happens send x info to the server using XMLHTTP and use the resulting XML to populate the combo using JScript.
XSL doesn't really fit in here.
Cheers,
Simon
"Every good work of software starts by scratching a developer's personal itch.", Eric S. Raymond
|
|
|
|
|
|
|
Has anyone taken the time to create some schemas for validating SQLXML documents? For example, I'd like to be able to validate an updategram before posting it to my server. Also, the cool intellisense features of having an associated schema would be nice...
Sooner or later, I'll probably take the time to hammer one out, myself, but I thought I'd save the time and effort if someone else has already done this...
Surely Microsoft has just such schemas internally, I wonder why they don't release them. (I've asked a couple times and never gotten a response...)
Thanks!
|
|
|
|
|
I thikn I saw something about that in the Extreme XML column on the MSDN site.
Alice thought that running very fast for a long time would get you to somewhere else. " A very slow kind of country!" said the queen. "Now, here , you see, it takes all the running you can do, to keep in the same place".
|
|
|
|
|
OK, I've got my source document, right? And it uses two different namespaces, my custom one and the XHTML one. The contents of it are a mix of XHTML and my own markup. So the header on that looks like this:
<Page xmlns="/PageWriter/TemplateSchema.xsd" xmlns:XHTML="http://www.w3.org/1999/xhtml">
Now, I've got my XSL stylesheet, right? And it's used to take the source document and transform it into pure XHTML. So I've figured out that I need to do this in my header, I think:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:MHC="/PageWriter/TemplateSchema.xsd">
<xsl:output encoding="utf-8"
indent="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
And thereafter all references in my <xsl:...> tags that refer to my own custom elements use the prefix MHC: , like so:
<title>MadHamster Creations - <xsl:value-of select="MHC:Page/MHC:Head/MHC:Title" /></title>
BUT! The problem is now that I have a few weird output issues. The first of all, and this one is really bad because it makes my documents not validate as XHTML, is that my <html> tag now looks like this:
<html xml:lang="en-US" lang="en-US" xmlns:MHC="/PageWriter/TemplateSchema.xsd" xmlns="http://www.w3.org/1999/xhtml">
Not like this, which is how it's supposed to look but doesn't:
<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
The other weird thing occurs only when I call a template from inside my main template, like so:
<xsl:apply-templates select="MHC:Page/MHC:Body" />
The header for the other template is:
<xsl:template match="MHC:Page/MHC:Body" name="ProcessBody">
Inside the main template, everything works fine. But when I call this other template, all of my XHTML elements generated inside that template have this extra attribute in them. The attribute is xmlns="" , which is needless to say redundant, although it doesn't make the document invalid.
Why? How can I stop it?
Anyone who wants more in-depth information can get my source files and a .NET utility to transform them, by e-mailing me. Think of it as an interesting intellectual challenge! Yeah, that's it! A challenge! Come and fix it, smart people.
Well, thanks in advance.
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
Heya,
to get rid of the unnecessary XSL/XML info in your ouptut data then put the attribute 'exclude-result-prefixes' in the xsl:stylesheet node, like this:
<xsl:stylesheet
="" version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:mhc="/PageWriter/TemplateSchema.xsd" exclude-result-prefixes="MHC">
Just space-separate all the namespace prefixes you do not want in the result.
I also set the 'omit-xml-declaration' to "yes" in the xsl:output element to get rid of the XML declaration.
/WW
|
|
|
|
|
Thanks a ton for the response! I was beginning to think nobody knew...
Anyways, the exclude-result-prefixes works great to get rid of the extra xmlns:MHC="..." in my <html> tag. I need to keep the XML declaration for valid XHTML however, but thanks for the help anyways.
So, any ideas on the empty xmlns="" attribute that pops up in those elements? Rather weird...
Thanks again, it's really reat to have someone who knows this stuff!
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
Okay - I am fairly new to XSL and am trying to embed some JavaScript into an existing XSL stylesheet. The JS is to prevent the refresh from blinking. This is a really long post - just a warning!!
This is a sample of the XSL where I need to embed the script:
<xsl:template name="coursestats">
<xsl:param name="Round"/>
<xsl:variable name="CourseAcronym" select="@CourseAcronym"/>
<table border="0" cellpadding="0" cellspacing="0" background="/images/mybg.gif" width="642">
<tr>
<td width="1" bgcolor="Olive"> </td>
<td width="34" height="14" class="titClass">Hole</td>
<td width="1" bgcolor="Olive"> </td>
<td width="30" height="14" class="titClass">Par</td>
<td width="1" bgcolor="Olive"> </td>
<td width="54" height="14" class="titClass">Yardage</td>
<td width="1" bgcolor="Olive"> </td>
<td width="74" height="14" class="titClass">Scoring Avg</td>
<td width="1" bgcolor="Olive"> </td>
<td width="34" height="14" class="titClass">Rank</td>
<td width="1" bgcolor="Olive"> </td>
<td width="106" height="14" class="titClass">Avg Over/Under Par</td>
<td width="1" bgcolor="Olive"> </td>
<td width="40" height="14" class="titClass">Eagles</td>
<td width="1" bgcolor="Olive"> </td>
<td width="42" height="14" class="titClass">Birdies</td>
<td width="1" bgcolor="Olive"> </td>
<td width="38" height="14" class="titClass">Pars</td>
<td width="1" bgcolor="Olive"> </td>
<td width="54" height="14" class="titClass">Bogeys</td>
<td width="1" bgcolor="Olive"> </td>
<td width="82" height="14" class="titClass">Double Bogeys</td>
<td width="1" bgcolor="Olive"> </td>
<td width="54" height="14" class="titClass">Other</td>
<td width="1" bgcolor="Olive"> </td>
</tr>
<xsl:for-each select="Hole">
<xsl:sort select="@HoleNumber" order="ascending" data-type="number"/>
<tr> <td width="1" bgcolor="Olive"> </td>
<td width="34" height="14" class="txtClass"><xsl:value-of select="@HoleNumber"/></td> <td width="1" bgcolor="Olive"> </td>
<td width="30" height="14" class="txtClass"><xsl:value-of select="@Par"/></td> <td width="1" bgcolor="Olive"> </td>
<td width="54" height="14" class="txtClass"><xsl:value-of select="@PublishedYardage"/></td> <td width="1" bgcolor="Olive"> </td>
<xsl:variable name="numerand" select="Round[@Number = $Round]/ScoreN"/>
<xsl:variable name="operand" select="Round[@Number = $Round]/ScoreO"/>
<td width="74" height="14" class="txtClass">
<xsl:if test="$numerand != 0"><xsl:value-of select="format-number($operand div $numerand, '0.000')"/></xsl:if>
</td> <td width="1" bgcolor="Olive"> </td>
This is the start of the JS that I am using - it works in my HTML but when I try to embed into the XSL I only get the opening and closing JS tags for output:
<html><head>
<script language="JavaScript"> <!--
function makeChange() {
var newData = '';
// START DATA
newData += '<table border=0 cellpadding=0 cellspacing=0 background="/images/mybg.gif" width="642">';
newData += '<tr>';
newData += ' <td width="1" bgcolor="Olive"> </td>';
newData += ' <td width="34" height="14" class=titClass>Hole</td>';
newData += ' <td width="1" bgcolor="Olive"> </td>';
newData += ' <td width="30" height="14" class=titClass>Par</td>';
newData += ' <td width="1" bgcolor="Olive"> </td>';
newData += ' <td width="54" height="14" class=titClass>Yardage</td>';
newData += ' <td width="1" bgcolor="Olive"> </td>';
newData += ' <td width="74" height="14" class=titClass>Scoring Avg</td>';
newData += ' <td width="1" bgcolor="Olive"> </td>';
newData += ' <td width="34" height="14" class=titClass>Rank</td>';
newData += ' <td width="1" bgcolor="Olive"> </td>';
newData += ' <td width="106" height="14" class=titClass>Avg Over/Under Par</td>';
newData += ' <td width="1" bgcolor="Olive"> </td>';
I don't know if my problem is the newData+=' '.
Can anyone shed some light?
THANKS!
Julia
|
|
|
|
|
Simple - here's how you can embed JavaScript into an XSL document...
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
...
<xsl:text disable-output-escaping="yes">
<![CDATA[
<script>
// your code goes here
</script>
]]>
</xsl:text>
...
</xsl:stylesheet>
HTH!
Essam - Author, JScript .NET Programming
...and a bunch of articles around the Web
|
|
|
|
|
Thanks - I'll give it a try.
Julia
|
|
|
|
|
I've been givin the task of developing a schema for some message formats. The formats are in XML and they all use common elements except for one. The group element is different for each of the messages. one message it may be of type lineGroup of another bitGroup. My question is how can I make my schema take either type group? I've found that one element name with 2 types does not work. So what is the work around? I'm new to this so if there is something I'm missing please fill me in. TIA.
example of the xml file (the <> were intentionally left out)
in one file...
group type="lineGroup"
name message1 /name
.
.
.
/group
In the other file
group type="bitGroup"
name message2 /name
.
.
.
/group
nay
|
|
|
|