|
Who knows... But I can tell you two things at first glance to consider:
1. This is a C# question, not an XML question.
..and..
2. System.Text.StringBuilder is your friend.
|
|
|
|
|
Ihave a COM method which has Input,Outout as XML,
It includes loading a string in to XMLDOM and processing on the nodes.
i have used memory leak article on CP to find the MemoryLeak http://www.codeproject.com/tools/leakfinder.asp[^]
from my observation and some reading on google, it seems that Release() and LoadXML are two methods which seems to have some memory leak, but i simply could not find the work arround, i have also gone through the "Delayed Clean up mechanism" but again without solution to my problem
big problem is as the output XML grows there is more wastage of memory, as this method is called arround ~4200 time a day the resultant is mess
If this is a repost kindly redirect(as of now i can see only one post in the XML section)er to question !
|
|
|
|
|
I hope its not a memory leak its catching...
Caching
Caching situations will usually show up as leaks in leakdiag because they are allocations that have not been freed. In some situations, it is possible to prevent false positives by disabling caching. Otherwise, it would require a code review to identify the allocations are actually being cached for later reuse. If the leaks are showing up in specific allocators, then tracking only that allocator will prevent caching from appearing to be a leak since LeakDiag will tracke the originating allocation call instead of the underlying heap or virtual alloc calls which might be cached by the component. The COM allocator is one example of an allocator that can be used to prevent false leaks due to caching.
Regards
Anil
|
|
|
|
|
Hi there.
I have this:
<resource identifier="32413BBC_D42E_4E72_9C2B_5CCFB9662DD1" width="380" height="280" type="image/jpeg">
<uri>img024.jpg</uri>
<title>
<![CDATA[ Securing and Configuring Exchange Distributed Services Using IIS Lockdown
]]>
</title>
</resource>
I can get the <uri> value, but i cannot get the <title> value. Can anyone help with this??
Thanks
-- modified at 0:57 Saturday 16th June, 2007
|
|
|
|
|
what cant you get? a little more information please.
And i think this should ba a screenshot?
cheers
|
|
|
|
|
Icarus123 wrote: but i cannot get the <title> value.
w3schools.com wrote: Everything inside a CDATA section is ignored by the parser.
CDATA[^]
|
|
|
|
|
For a simple example, I have an access database which has 2 columns:
Let's say one column is InputXML and other column is OutputXML that we want.
This contains the mapping rules.
The table structure is as follows:
INPUTXML OUTPUTXML
Fname First Name
Lname Last Name
So basically Fname in input XML should be changed to First Name in output XML. So the database just has the mapping rules for the transformation and not the values.
Now the task is to create a dot net windows application that has a button called GENERATE XSLT . On clicking this button, it should dynamically generate the XSLT taking the mapping rules from the database. In other words instead of hardcoding the XSLT , based on the DB mapping rules like Fname to FirstName etc, it should just generate the code for XSLT in a txt file or XSL file, which is the code which does the transformation.
So basically an XSLT code generator should be written.
Someone said there is a function call or API in dot net which generates the xslt template, I just have to define the relationships among them using values from DB. Not even sure what this means.
Any help on how to approach solving this problem or some starting idea (some psuedo code or anything ) would be great, I am learning Dot net as well as XML/XSLT.
If you are aware of the API also, please let me know as it will save me some searching time. Hope someone helps.
Thanks,
Sdee
sdee
|
|
|
|
|
sdee2 wrote: Someone said there is a function call or API in dot net which generates the xslt template
System.Xml.Xsl.XslTransform is the XSLT processor but I am not aware of any library that generates XSLT. However XSLT "is" XML so you can use any of the XML mechanisms to create XSLT.
|
|
|
|
|
Hello, it's me again :p
I'm searching on the web for over two hours now, but I have not found what I am looking for.
So... can anyone provide me a link to a list of all possible xml character sets?
charset example:
<?xml version="1.0" encoding="gb2312" ?>
-> gb2312 == Chinese
Thank You!!
~uumppa
|
|
|
|
|
|
hello,
Ive come across a highlight function that i was able to add to a search feature i have on a page. however the current method it uses will wrap text that is found even inside of html so its making the tags no longer work. has anyone dealt with this type of thing before?
here's the highlighter template
example of problem
$text = <a href="http://www.walkthroughs.com">Simple steps to walkthrough</a>
$what = walk
output=<a href="http://www.<font style...>walk</font>throughs.com">Simple steps to <font style...>walk</font>through</a>
<code> <xsl:template name="highlighter">
<xsl:param name="text"/>
<xsl:param name="what"/>
<xsl:variable name="test-text">
<xsl:call-template name="lower">
<xsl:with-param name="tolower" select="$text" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="test-what">
<xsl:call-template name="lower">
<xsl:with-param name="tolower" select="$what" />
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains($test-text, $test-what)">
<xsl:variable name="before" select="substring-before($test-text,$test-what)"/>
<xsl:variable name="after" select="substring-after($test-text,$test-what)"/>
<xsl:variable name="real-before" select="substring($text, 1,string-length($before))"/>
<xsl:variable name="real-after" select="substring($text,string-length($before) + string-length($what) + 1)"/>
<xsl:value-of select="$real-before" disable-output-escaping="yes"/>
<font style="background-color:#66FF66"><xsl:value-of select="$what" disable-output-escaping="yes"/></font>
<xsl:call-template name="highlighter">
<xsl:with-param name="text" select="$real-after"/>
<xsl:with-param name="what" select="$what"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template></code>
Id appreciate any insight on this. i thought that perhaps i could examine for an unclosed < in before variable and unopened > in after but im not sure what the best way to do this would be
Thanks in advance
werD, MCP
|
|
|
|
|
this is what im thinking.
the higlighter template uses before term and after
so
$text = <a href="http://www.walkthroughs.com">Simple steps to walkthrough</a>
$what = walk
before1 = <a href="http://www.
term1 = walk
after1 =throughs.com">Simple steps to walkthrough</a>
im thinking that i can use a reverse function and have
before1rev = .www//:ptth"=ferh a<
after1rev = >a/<hguorhtklaw ot spets elpmiS>"moc.shguorht
i was thinking i could run some logic off of that to get an intended result but now im just dizzy :S
any thoughts?
CODE
<xsl:template name="nonhtmlreplace">
<xsl:param name="before" />
<xsl:param name="before-reversed"/>
<xsl:param name="after" />
<xsl:param name="after-reversed" />
<xsl:param name="what" />
<xsl:choose>
<xsl:when test="contains($before-reversed,'<') and not(contains($before-reversed,'>'))">
/\<xsl:value-of select="$before" disable-output-escaping="yes"/><xsl:value-of select="$what" disable-output-escaping="yes"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="string-length(substring-before($before-reversed,'<')) < string-length(substring-before($before-reversed,'>'))">
<xsl:value-of select="$before" disable-output-escaping="yes"/>
<font style="background-color:#66FF66">
<xsl:value-of select="$what" disable-output-escaping="yes"/>
</font>
</xsl:when>
<xsl:otherwise>
-<xsl:value-of select="$before" disable-output-escaping="yes"/>
<xsl:value-of select="$what" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
here's the reverse function im using
CODE
<xsl:template name="reverse">
<xsl:param name="theString"/>
<xsl:variable name="thisLength" select="string-length($theString)"/>
<xsl:choose>
<xsl:when test="$thisLength = 1">
<xsl:value-of select="$theString"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="restReverse">
<xsl:call-template name="reverse">
<xsl:with-param name="theString"
select="substring($theString, 1, $thisLength -1)"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of
select="concat(substring($theString,
$thisLength,
1
)
,$restReverse
)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
|
|
|
|
|
Hello. I have the doc. representing the message. It consists of header and body and has the following structure:
<br />
<message><br />
<header>blah-blah-blah</header><br />
<body/><br />
</message><br />
Of course I can define all of these with xsd.
But the body element can only be of 1 of the following forms:
<br />
<body type="SIMPLE"><br />
<el1>string contents</el1> <br />
</body><br />
or
<br />
<body type="COMPLEX"><br />
<el2>int contents</el2> <br />
<el3>int contents</el3> <br />
</body><br />
I can define this with xs:group's, but without attribute restrictions. Unfortunately, groups can't include xs:attribute.
Any ideas how to define it with xsd?
|
|
|
|
|
Ok so I made an XML data sheet that works fine, but i know i will need the data. So i need to be able to make the XML display the correct info according to the id="" How do I do this?
script.js:
//parser start
var xmlDoc;
function loadXML(){
//load xml file
// code for IE
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("product_info.xml");
getmessage();
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
xmlDoc.load("product_info.xml");
xmlDoc.onload=getmessage;
}
else
{
alert('Your browser cannot handle this script');
}
}
// Actual message maker
function getmessage()
{
document.getElementById("name").innerHTML=xmlDoc.getElementsByTagName("name")[0].childNodes[0].nodeValue;
document.getElementById("file_size").innerHTML=xmlDoc.getElementsByTagName("file_size")[0].childNodes[0].nodeValue;
document.getElementById("summary").innerHTML=xmlDoc.getElementsByTagName("summary")[0].childNodes[0].nodeValue;
document.getElementById("version").innerHTML=xmlDoc.getElementsByTagName("version")[0].childNodes[0].nodeValue;
}
//parser end
function dio(){
window.open("dio.html")
}
dio.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="SHORTCUT ICON" href="images/logo_orig/info.ico" />
<script src="script.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Product Info</title>
</head>
<body onload="loadXML()" bgcolor="#fffacd" text="#000000" link="FF4500">
<center>
<h1>Product Information</h1>
</center>
<p>
<b><u>File Name: </u></b><span id="name"></span><br />
<b><u>File Size: </u></b><span id="file_size"></span><br />
<b><u>File Summary: </u></b><span id="summary"></span><br />
<b><u>File Version: </u></b><span id="version"></span><br />
</p>
</body>
</html>
product_info.xml:
<?xml version="1.0" encoding="iso-8859-1"?>
<products>
<download>
<name>Bustin' Blox</name>
<file_size>2 Mb</file_size>
<summary>Our version of Brick. Only One Level (Kinda Sucks)</summary>
<version>1.0.0</version>
</download>
</products>
|
|
|
|
|
|
Hi,
I want to fetch the soap envelope every time when I call the web service.
Currently I m passing the values in object and the object gets passed into the Web method. I need that Soap envelope what dot net internally generate to call this web service.
|
|
|
|
|
run your service in the browser and it'll display you its specification: all public methods and their call signatures
|
|
|
|
|
No...
this is not what I m looking for...
I am calling a web service by passing an object to the Web method. Now I want that soap envelope that .net generating internally.
|
|
|
|
|
i`ve a xml file name myxml.xml which is as follows:
<RPS>
<RP>
<Paper_title>abcd</Paper_title>
<Authors>
<Author>rony</Author>
<Author>tony</Author>
<Author>sony</Author>
</Authors>
<Journal_or_Conference>abcd</Journal_or_Conference>
</RP>
<RP>
<Paper_title>abcd</Paper_title>
<Authors>
<Author>dip</Author>
<Author>tom</Author>
<Author>adam</Author>
</Authors>
<Journal_or_Conference>abcd</Journal_or_Conference>
</RP>
<RP>
<Paper_title>abcd</Paper_title>
<Authors>
<Author>mark</Author>
<Author>tony</Author>
<Author>bruce</Author>
</Authors>
<Journal_or_Conference>abcd</Journal_or_Conference>
</RP>
</RPS>
i want to write a xsl file that makes the above xml file in tabular format as following:
Authors Paper title Journal or Conference Year Pages
and also if Author is tony then the text tony should be in bold.
|
|
|
|
|
Check out the XSLT tutorial on www.w3schools.com. If I remember well the example they provide does just this.
|
|
|
|
|
Hi guys i have one query,
I created textboxes dynamamicaly. when i select 2 in dropdown list two text boxes will come same i will select 100 or more. that i created, now i want to how to validate those text boxes? i done server side vaditation but i want to client side validation. so please help me.....
Thanks advance
praveen kumar....................
Praveen Kumar.R
|
|
|
|
|
I think you need to post this in the ASP.NET forum. Anyway, why don't you create validation controls dynamically too. On the server side you can access the dynamic textboxes client IDs and set up your validation controls accordingly to your needs.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi guys
Can anyone tell me where I could obtain a copy of XMLClassGenerator.exe?
I have tried the net but no luck.
Regards
Carmelo
|
|
|
|
|
Try searching with "XML Code Generator".
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Thank you for that George I have already tried but it does not come up with the one I want.
I am hoping someone might have it amongst there collection of utilities.
Regards
Carmelo
|
|
|
|