Is it possible to use single XSLT 1.0 file for different ASP.NET pages? -
i've tried find on internet clear answer question if it's possible use single xslt 1.0 file different asp.net pages, didn't find it.
i'm not sure how should work. have use parameters , kind of sections in xslt file?
the example more welcome.
yes can use same xslt multiple pages setting xml.transformsource code behind
quote msdn
the transformsource property used specify path xsl transformation style sheet file (representing xsl transformation style sheet) used format xml document before written output stream. can use relative or absolute path. relative path relates location of file location of web forms page or user control, without specifying complete path on server. path relative location of web page. makes easier move entire site directory on server without updating path file in code. absolute path provides complete path, moving site directory requires updating code.
it's possible define source , transform file code behind:
example msdn
void page_load(object sender, eventargs e) { xmldocument doc = new xmldocument(); doc.load(server.mappath("people.xml")); xsltransform trans = new xsltransform(); trans.load(server.mappath("peopletable.xsl")); xml1.document = doc; xml1.transform = trans; }
edit
i don't understand mean with:
i need tell me go inside file.
but if need arguments in transformation, use transformargumentlist
xsltargumentlist xslarg = new xsltargumentlist(); datetime d = datetime.now; xslarg.addparam("date", "", d.tostring()); xml1.transformargumentlist = xslarg;
Comments
Post a Comment