|
Hey,
I have a HTML document with a lot of (random placed) XML -files in a table. Now if a field has more then 100characters I want to open it in a popup (with a button) but! because my XML-files contain quotes and so it gives errors. How can u solve this problem?
thx!
|
|
|
|
|
Solution is simple: escape your XML data before showing. Escaping converts " symbols to " sequence.
Look at the escape function in JS reference.
-------------------------
Don't worry, be happy )
|
|
|
|
|
there is the problem, you cant give quote as parameter in a Javascript And you are saying to escape it with a javascript...
thx!
|
|
|
|
|
Just looked in MSDN - escape isn't that method, sorry...
This function helps me:
function escapeString(str)
{
var escAmpRegEx = /&/g;
var escLtRegEx = /</g;
var escGtRegEx = />/g;
var quotRegEx = /"/g;
var aposRegEx = /'/g;
str = str.replace(escAmpRegEx, "&");
str = str.replace(escLtRegEx, "<");
str = str.replace(escGtRegEx, ">");
str = str.replace(quotRegEx, """);
str = str.replace(aposRegEx, "'");
return str;
} After using it, str will not contail any illegal chars.
-------------------------
Don't worry, be happy )
|
|
|
|
|
I have escaped it in C# before it's written now
thx!
|
|
|
|
|
Hi!
I am facing problem when inserting large amount of data in XML file. I am using XML file as a replacement of database table. My application stores as many as 100000 or more records in XML file, but it takes too much time in inserting these records (almost 5-10 minutes).
I have made such insertion before but at that time structure of each node of XML was very simple with no child nodes, it took 1-2 seconds to insert 100000 records at that time. But now structure of each node is as follows:
<mobilenumberinfo id="1">
<groupid>1
<mobilenumber>123456
<isblacklisted>False
<contactmemo>
<mobileusername>
<mobilenumberinfo id="1">
Please tell me why this problem is occuring, can XML be used as alternative of database? Previously i was using MS Access for this purpose but faced same problem so swithched to XML but my problem is not solved.
Thanks in advance...
Regards,
Affan Ahmad Toor
|
|
|
|
|
It's quite hard to answer your question. What tools/languages/APIs you are using? Depending on those, runtime speed can vary greatly.
XML files can be used instead of relational databases if you don't need any of DBMS functionality, like data integrity checking, etc.
-------------------------
Don't worry, be happy )
|
|
|
|
|
Hi!
Thanks for reply! i am using C# 2005. my application is using GsmComm library but that is not related to this portion.
Can you tell me about any technique to make it more fast, by using code optimization or some thing else...
one more thing! is it OK to use XML file for such purpose? or i must use database for this...?
Regards,
Affan Ahmad Toor
|
|
|
|
|
Affan Toor wrote: i am using C# 2005
I think that you'd better ask C# forum about the best ways of handling XML.
To be short, there are many ways you can handle XML with .NET. The most simple ones (through the XmlDocument ) are also the most resource intensive.
Affan Toor wrote: one more thing! is it OK to use XML file for such purpose? or i must use database for this...?
As I said before, it depends It is a matter of many experiments to decide what is best.
-------------------------
Don't worry, be happy )
|
|
|
|
|
Thanks alot!
Regards,
Affan Ahmad Toor
|
|
|
|
|
Affan Toor wrote: I am using XML file as a replacement of database table
And there is the problem you are facing. XML is NOT a replacement for a Database. But don't believe me... use a secret web site called Google to search for articles about XML and you will find many people stating the same thing.
led mike
|
|
|
|
|
hhhummmm! So what do you suggest i should use here....? Database is not working, XML is not working then what is left...?
Regards,
Affan Ahmad Toor
|
|
|
|
|
Affan Toor wrote: Database is not working, XML is not working
The reason is not "not working", but "I haven't found the best way to handle XML".
Best regards,
- Dmitry.
-------------------------
Don't worry, be happy )
|
|
|
|
|
Affan Toor wrote: Database is not working
What is that supposed to mean?
led mike
|
|
|
|
|
Hi!
It means that i tried MS Access for this purpose, but faced same problem. It took more time than XML to insert 100000 records, and now XML also did'nt fulfill my requirement. Now i am on a dead end, i dont have any idea what to do now.....
Regards,
Affan Ahmad Toor
|
|
|
|
|
Investigate SQL Server Express and BULK INSERT
led mike
|
|
|
|
|
It's really bad idea to store data in XML for performance reasons*. XML is great for files that should be easily readable and editable by both mashine and human - such as config files - but BIG table or whole database is probably not the case; and as format for data exchange between (possibly) different platforms.
Affan Toor wrote: So what do you suggest i should use here....?
As suggested by led mike, SQL server.
[edit]*what I mean is that XML performance for large data is terrible[/edit]
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
hello ..I have the following problem
<Document>
<Employee>
<Name>John</Name>
<Class>A95</Class>
<ID>E5</ID>
</Employee>
<Employee>
<Name>Bill</Name>
<Class>B96</Class>
<ID>E4</ID>
</Employee>
<Employee>
<Name>John</Name>
<Class>A95</Class>
<ID>E5</ID>
</Employee>
</Document>
and I want for every Employee element to save it in html file
(Name of file depend on ID)
is it possible
tkml123
|
|
|
|
|
Tklem123 wrote: is it possible
yes
led mike
|
|
|
|
|
Ummm... yes? (But I don't think XSL will do it.)
|
|
|
|
|
Please refer this[^] for more information.
Regards,
Paresh.
|
|
|
|
|
Can anyone please tell me what is DTD/XSD ??
My client wants the DTD/XSD for creation of xml files. Can anyone please send me an example if youll have
|
|
|
|
|
DTDs and XSDs (Xml Schema) are files that specify the allowable structure of XML files. They define the entities and relationships represented in XML files. So that you can validate XML against them to know that your XML conforms to the rules of the DTD/XSD.
DTDs are the old standard for doing this. XSDs are the new standard. Google XSD and you'll find lots of references. If you don't really want to learn XSD right this minute, or you just need an XSD spec immediately, there are tools out there that can help. XMLSpy will generate an XSD from XML if you have sack loads of cash. Skeleton Crew[^] can also produce an XSD for you. Just drop in some XML that has all your possible nodes/attributes, set your renderer to XSD, and build. The XSD that's generated will likey need a little work (changing the optional/required attributes where appropriate), but it will give you a good starting schema. But like I said, google XSD, W3 Schools has a good XSD reference to help you finish your spec out.
Hope that helps.
|
|
|
|
|
hello
i am new user of this group.i have a problem in javascript. i have already created treecheckbox but the node name came manualy. how to show the treecheckbox node name from the xml file.
Plz. reply me as soon as possible.
Thanks.
Shalini
snitu
|
|
|
|
|
hey,
I'm trying to open a script in a new window but the script is in a form like this:
<table name="qml_scripts"><br />
<row><br />
<column name="QMLSCR_KEY">1</column><br />
<column name="QMLSCR_CODE">REPORTS_OUT</column><br />
<column name="QMLSCR_SOURCE">'##################################################################################################<br />
' VBScript for XML Billing Interface towards HL7 (DFT specific)<br />
' made by JDS (c) Agfa-Quadrat N.V.<br />
'<br />
' Usage : In combination with :<br />
' =============================<br />
' * QSender where XML is generated by script HL7_DFT_BILLING.SQL<br />
' (Events ONL_INT_INV or ONL_INT_DFT)<br />
' * QDFACXML_NLX where XML is generated by snapshot packages<br />
'<br />
'##################################################################################################<br />
'version: 2005.3.0<br />
'Last Changed: Apr 02, 2007<br />
'Reason:
and so on...
Now, when I pass this argument to my javascript he gives an error on the enters and quotes
XSLT:
<br />
< xsl: for-each select="/table/row[1]/column"><br />
encode(< xsl: value-of select="." />)<br />
< / xsl:for-each><br />
Can I encode this or open that script in another window?
thx alot!
|
|
|
|