Click here to Skip to main content
15,905,782 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: root element is missing Pin
DavidNohejl22-Jun-05 12:58
DavidNohejl22-Jun-05 12:58 
GeneralRe: root element is missing Pin
Ahmed Galal22-Jun-05 13:04
Ahmed Galal22-Jun-05 13:04 
Generalconfused Pin
Anonymous21-Jun-05 3:41
Anonymous21-Jun-05 3:41 
GeneralRe: confused Pin
Anonymous21-Jun-05 3:47
Anonymous21-Jun-05 3:47 
Questionhow to contract empty tag <col></col> to <col/> in XSLT Pin
Lyteck21-Jun-05 1:54
Lyteck21-Jun-05 1:54 
AnswerRe: how to contract empty tag <col></col> to <col/> in XSLT Pin
Javier Lozano22-Jun-05 11:48
Javier Lozano22-Jun-05 11:48 
GeneralRe: how to contract empty tag <col></col> to <col/> in XSLT Pin
Lyteck27-Jun-05 3:13
Lyteck27-Jun-05 3:13 
GeneralLoading custom control from XSLT Pin
randomnumber21-Jun-05 0:59
randomnumber21-Jun-05 0:59 
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.
GeneralXSD Problem Pin
matt cole20-Jun-05 16:06
matt cole20-Jun-05 16:06 
GeneralXSD Problem Pin
Chetan Ranpariya13-Jul-05 22:29
Chetan Ranpariya13-Jul-05 22:29 
GeneralProblem creating working XSD with restrictions Pin
clatten20-Jun-05 1:42
clatten20-Jun-05 1:42 
GeneralProblem Creating XML [SOLVED] Pin
Paolo Ponzano20-Jun-05 0:16
Paolo Ponzano20-Jun-05 0:16 
QuestionWhy do i allways get the same value? Pin
shapper18-Jun-05 12:57
shapper18-Jun-05 12:57 
QuestionIs this possible ? Pin
Wilbur J. Pereira18-Jun-05 0:38
Wilbur J. Pereira18-Jun-05 0:38 
GeneralXML As Database Pin
Gaurang Desai17-Jun-05 22:45
Gaurang Desai17-Jun-05 22:45 
GeneralRe: XML As Database Pin
Ahmed Galal22-Jun-05 12:57
Ahmed Galal22-Jun-05 12:57 
Generalsetting the parameter value based on condition Pin
D.Sridhar17-Jun-05 10:38
D.Sridhar17-Jun-05 10:38 
GeneralSuitability of XML Pin
Anonymous17-Jun-05 5:50
Anonymous17-Jun-05 5:50 
GeneralRe: Suitability of XML Pin
DavidNohejl17-Jun-05 5:58
DavidNohejl17-Jun-05 5:58 
QuestionHow to improve my code? Thank You. Pin
shapper17-Jun-05 5:31
shapper17-Jun-05 5:31 
Generalcreating nested comparison through the xml property Pin
Member 205376617-Jun-05 4:20
Member 205376617-Jun-05 4:20 
QuestionHow to format this date? Pin
shapper16-Jun-05 14:01
shapper16-Jun-05 14:01 
AnswerRe: How to format this date? Pin
Christian Graus16-Jun-05 14:09
protectorChristian Graus16-Jun-05 14:09 
GeneralRe: How to format this date? Pin
shapper16-Jun-05 14:32
shapper16-Jun-05 14:32 
GeneralRe: How to format this date? Pin
Christian Graus16-Jun-05 14:36
protectorChristian Graus16-Jun-05 14:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.