|
I would appreciate if someone could explain what data I need to pass through to the SHA1 digest function to produce the same DigestValue as in the example below. When I pass the content of the ns1:Operation node I get a completely different DigestValue to that shown in the example! Do I need to add in any other data i.e. another ns value???
Here are the parts of the XML document of interest for this calculation, if you need further data let me know:
<ns1:Operation Id="MsgOperation" soapenv:mustUnderstand="0"
xsi:type="xsd:string" xmlns:ns1="http://www.ros.ie/schemas/service/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance">CT1/File</ns1:Operation>
...
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#MsgOperation">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>wJsL4RtLToFeHW/xt2ewbAAiNxk=</ds:DigestValue>
</ds:Reference>
|
|
|
|
|
I am using an xml file as a data source for site navigation on my asp website. All but one link points to files that are contained with in the project. Here is an example:
<section>
<id>customers</id>
<image>customers.jpg</image>
<name>Customers</name>
<url>customers/</url>
<subSection>
<id>retail</id>
<name>Retail Cheese Shop</name>
<url>customers/retail/</url>
<detailSection>
<id>logoitems</id>
<name>Alto Logo Items</name>
<url><http://www.companycasuals.com/altodairy/start.jsp</url>
</detailSection>
</subSection>
</section>
The urls all work with one exception. The last <detailsection> points to a website outside of the project.
When I run this I get an error message that says: Cannot use a leading .. to exit above the top directory.
Does anyone know what I would use to exit above the top directory?
John
|
|
|
|
|
I think your chance to get an answer is much higher in the ASP.NET forum as the scope of your question of course involves an XML file but it is nevertheless very ASP.NET specific.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
"\" this is coming in my Xml output.I want eliminate this.
I am writing code in C# using StringBuilder class and XMLTextWriter.
Any Properties or Method's are there to eliminate this.
|
|
|
|
|
saymajum wrote: I am writing code in C# using StringBuilder class and XMLTextWriter.
Show us the code, so we can tell you what you're doing wrong.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
i have a database object which retrieves all the data.
and i have the xml file(excel format) in textwriter mode. how can i attach dtaset to xml file and i want to transform that using xsl file
can any body know this pls help me
thanks
satya
|
|
|
|
|
Hi,
This is not a solution to your question, I have a similar problem where I need to export to Excel from a database. I am having no success. Please if you have a solution please can you let me know.
Regards
ma se
|
|
|
|
|
Hi
i am using c#.net
this is my code may be it is helpfull to u.
XmlDataDocument xdd= new XmlDataDocument(dataset object )
XslCompiledTransform xt=new XslCompliedTransform()
xt.load("~/.xsl");
XslArgumentlist xal=new XslArgumentlist();
xt.transform(xdd,xal,response.output);
if u r using c# this is helpfull to u and add response.contenttype,response.addheader
thanks
|
|
|
|
|
fireDiary = "<?xml version="1.0"?>"+"<AscendantOne>"+"<?ao-type diarysave?>"+
"<?ao-userid " + aouserid.InnerText+"?>"+"<Activity type="system" description="Activity">"+
"<VersionedId/>+<Id /><Effective>06/07/2007</Effective ><Expiration /><Created>06/07/2007</Created>"+
"<CreatedBy>"+aouserid.InnerText+"</CreatedBy>"+"<Modified /><StepId /><Category>Testing POC</Category>"+
"<Type>ForPOC</Type>+<Description>Testing diary for POC. This is being triggered from Custom override</Description>+<Entered></Entered>"+
"<EnteredBy>"+aouserid.InnerText+"</EnteredBy>+<Scheduled />+<UserId >{B6398B1E-43D3-4521-BFE3-235C2073AFF4}</UserId>"+
"<Open /><Completed /><Completion /><CurrentStatus>Open</CurrentStatus><StatusChange /><Comment /></Activity></AscendantOne>";
-- modified at 23:43 Friday 15th June, 2007
|
|
|
|
|
saymajum wrote: Is there anything wrong in this statement
There is definitely something wrong with the question. First, what should this statement do? Second, what is not being done what should be done i.e. what is going wrong? Third, are you sure the statement displays as it should be? Especially the first line looks pretty weird.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
For starters, you didn't check 'ignore tags', so your message was not legible. Second, what do YOU think is wrong with it, and why ? And why do you think someone would trawl through all that code looking for an error ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
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>
|
|
|
|