Hot answers tagged

5

based on: https://stackoverflow.com/questions/4845660/xsl-how-to-split-strings <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tridion="http://www.xyz.com/tridion/schemas"> <xsl:output method="xml" encoding="utf-8" indent="no"/> <xsl:template match="tridion:Office/tridion:Telephone/text()" name="split"&...


5

In order to remove the namespace from the <p> element, all you have to do is apply a blank namespace attribute. The final (correct) filtering XSLT is the same as the original except for this line: <element name="p" namespace=""> Once I applied this change, I was able to get the correct output: <p>Test</p>


4

You may try to put 'exclude-result-prefixes' in stylesheet header. There are so many links with explanation how to do this. I just picked up one as example. https://stackoverflow.com/questions/827600/how-can-i-prevent-these-redundant-namespaces-from-an-xslt-stylesheet


4

The document() function will almost certainly cache the result, so if you call it twice, supplying the same URI, then the document will not be re-read and re-parsed on the second and subsequent occasions. Your custom function is not maintaining a similar cache.


3

This is indeed a generic XML/XSLT question and not specific to Tridion. But here's how I would write it (having not seen the rest of your XSLT and ignoring the $nSpace part): <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="utf-8" indent="yes"/> <xsl:template match="p[...


2

The XSLT mediator was created for SDL Tridion R5.3 up until 2011, since in SDL Tridion 2013, a new Template Building Block type was added, the XSLT template. That was done by adding the XSLT mediator to the release basically, rendering the mentioned extension void. So you should NOT try to install the XSLT mediator extension, just use the built in one ...


2

With the disclaimer of not having tried it, this is what I suggest: Declare an xhtml namespace in your stylesheet: xmlns:xhtml="http://www.w3.org/1999/xhtml" Declare to exclude namespace prefix xhtml from result: exclude-result-prefixes="xhtml" Finally, create your p element belonging to the xhtml namespace: <element name="p" namespace="xhtml">


2

Even though Bjorn's answer seems hypothetical, it is almost completely correct. :-) In general, so-called templating function sources (.NET classes which are exposing their methods to modular templates) are exposed in the XSLT mediator as extension functions in XML namespaces named as: http://www.sdltridion.com/ContentManager/FunctionSource/<...


2

You will need to invoke the (globally available) function RenderComponentPresentation as explained here. The builtin functions are found in Tridion.ContentManager.Templating.Expression.BuiltInFunctions but I have no idea if SDL attributed them with an XSLT namespace... Assuming they did and that namespace was "http://www.sdltridion.com/ContentManager/...


2

You need something like this: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:template match="/"> <tr> <xsl:text disable-output-escaping="yes">&lt;</xsl:text> td <xsl:value-of select="...


2

This is not caused by the XSLT, but rather by Tidy, which is also executed when an RTF is updated. The RTF content is wrapped in a <body/> tag before processing, so Tidy will remove anything that doesn't belong in the body of an html page. In your case, html and link elements don't belong in the body, so they are stripped. That only leaves the ...


2

The Tridion RTF XSLT formats HTML to XHTML, therefore updating the empty <div> tag to be a self closing tag. See questions like https://stackoverflow.com/questions/10537656/creating-anchor-links-in-rich-text-fields-with-sdl-tridion-2011-sp1 for examples of how to resolve this using an embedded span tag You will need something like <template match=...


2

If you are trying to read Component Link related text fields on XSLT Component Template. You can perform as below, <!-- Gets the Component Link Uri --> <xsl:variable name="abcLink" select="/tcm:Component/tcm:Data/tcm:Content/ref:XYZ/ref:ABCLink/@xlink:href" /> <!-- Gets the Content of Link Component --> <xsl:variable name="...


2

It is clearly given here that http://msdn.microsoft.com/en-us/library/ms163430(v=vs.110).aspx. This method does not support the xsl:strip-space element. If your compiled style sheet included the xsl:strip-space element, you must use the Transform overload which takes an XmlReader as the input argument.


2

I think the error is because the XML declaration claims that the encoding is UTF-16, but the actual encoding is not. XslCompiledTransform(which is used internally) has a tendency to put such an UTF-16 XML declaration in the output and ignore the encoding specified in the xsl:output element. Can you try what happens if you put omit-xml-declaration="true" on ...


2

This is how I would normally create a XML object in the package: package.PushItem(Package.OutputName, package.CreateStringItem (ContentType.Xml, Encoding.UTF8.GetString(stream.ToArray()))); And I would normally use a MemoryStream and XmlTextWriter (link to full example below). This would ensure that not only the XML document states it is ...


2

While the document() function can be made to work in other browsers than Internet Explorer, within Xopus it is only supported in Internet Explorer. So that message is correct. The best solution is indeed to use external SVG sources. Which, if I read your message, you are already doing. So it is not clear to me what you are using the document() function for. ...


1

If the rich text formatting options are the same across Schemas (or "schema," if @DomCronin is following) you could consider embedding the same rich text format area field and its XSLT filter options where needed. You would still need to use this field in your various schemas , but changes would be centralized and managed within a single field. ...


1

It was morphed into SDL LiveContent back in 2014 I believe. At that point it was called "LiveContent Create" and you can see where it lies in the stack here: https://docs.sdl.com/LiveContent/content/en-US/SDL%20LiveContent%20full%20documentation-v1/GUID-55008675-34AC-45DA-9D19-F2D08A44D3F4 If you search on that site you will see numerous references to Xopus....


1

AFAIK, the Xopus browser-based XML editor was never sold separately by SDL, but used as part of what is nowadays known as SDL Tridion Docs (the Structured Content Management product). In the latest version of SDL Tridion Docs, Xopus has been replaced by a more user-friendly, browser-based XML editor called Fonto


1

Seems like a tricky one to debug. In general, performance issues where "nothing has changed" is related to the database performance, and this can only be optimized by looking at database traces and making sure regular maintenance is executed on the DB - sp_updatestats on SQL Server and the scripts we ship for DB maintenance for Oracle. Usually we find out ...


1

Yes there is, though the message is incorrect 1. Typically, security settings prevent the document function to work in the browser, but it can work (I believe Sarissa removes this restriction with a workaround) if you change the browser settings. That said, you will still need a way to show the SVG. You are currently using xsl:value-of, which will return ...


1

I am guessing that it is because you are using this line itemObject.Load(LoadFlags.KeywordXlinks); This is forcing the system do load additional data which is not included in the default XML. I am not 100% sure, but I imagine when you call this flag, instead of loading just the Component object, it loads all of the Keyword objects in order to get the xlink:...


1

White-space handling is tricky at the best of times in XSLT. In this case, it's not clear what you are actually trying to achieve, but maybe strip-space isn't what you need anyway. I'd suggest that you check out this question on Stack Overflow. The answers by Dimitre Novachev and Michael Kay are both instructive (as are pretty much all the answers given by ...


1

I assume that you have to rearrange the creation of the <segment> node and your outer loop over the <CustomerSegmentType> nodes: <xsl:element name="{fn:concat($nodeName, 's')}"> <xsl:for-each select="./*"> <xsl:for-each select="$csfile//CustomerSegmentType"> <xsl:variable name="csid" select="@element_id" /> ...


Only top voted, non community-wiki answers of a minimum length are eligible