tag:help-archives.hannonhill.com,2010-02-09:/discussions/xslt-formats/6629-two-hyphens-in-an-asset-title-breaks-a-formatCascade CMS: Discussion 2016-05-25T17:30:11Ztag:help-archives.hannonhill.com,2010-02-09:Comment/395354462016-04-01T17:21:13Z2016-04-01T17:21:13ZTwo hyphens in an asset title breaks a format<div><p>Zip file of both files attached.</p></div>Rob Knighttag:help-archives.hannonhill.com,2010-02-09:Comment/395354462016-04-01T17:44:08Z2016-04-01T17:44:08ZTwo hyphens in an asset title breaks a format<div><p>Hi Rob,</p>
<p>The issue is that <code>--</code> is not valid XML, so the page
rendering is failing.</p>
<p>Your best bet would be to remove the double hyphen so you can
output the value correctly. The best option I can think of is to
use a Xalan function to replace double hyphens with a single one.
Such a function would look something like:</p>
<pre>
<code><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="hh" version="1.0" xmlns:hh="http://www.hannonhill.com/XSL/Functions" xmlns:xalan="http://xml.apache.org/xalan">
...
<xsl:template match="system-page">
<xsl:text>{"name": "</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>", "title": "</xsl:text>
<xsl:value-of select="hh:replaceDoubleHyphen(string(title))"/>
<xsl:text>", "url": "</xsl:text>
<xsl:text>http://news.ucsc.edu</xsl:text>
<xsl:value-of select="path"/>
<xsl:text>.html</xsl:text>
<xsl:text>", "date": "</xsl:text>
<xsl:call-template name="format-date">
<xsl:with-param name="date" select="start-date"/>
<xsl:with-param name="mask">mmmm dd, yyyy</xsl:with-param>
</xsl:call-template>
<xsl:if test="system-data-structure/lead-image/image/path != '/'">
<xsl:text>", "thumbnail": "</xsl:text>
<xsl:text>http://news.ucsc.edu</xsl:text>
<xsl:value-of select="system-data-structure/lead-image/image-thumb/path"/>
</xsl:if>
<xsl:text>"}</xsl:text>
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:template>
...
<xalan:component functions="replaceDoubleHyphen" prefix="hh">
<xalan:script lang="javascript">
<![CDATA[
function replaceDoubleHyphen(str) {
return str.replace(/-{2,}/g, '-');
};
]]>
</xalan:script>
</xalan:component>
</xsl:stylesheet></code>
</pre></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/395354462016-04-01T18:20:22Z2016-04-01T18:20:22ZTwo hyphens in an asset title breaks a format<div><p>Thank you for your prompt reply, Ryan! The double hyphen is
meant to mimic an mdash. Out of curiosity, is there any way to get
something like an mdash in a title? It seems like I cannot use the
HTML entity code for it.</p></div>Rob Knighttag:help-archives.hannonhill.com,2010-02-09:Comment/395354462016-04-01T18:25:59Z2016-04-01T18:25:59ZTwo hyphens in an asset title breaks a format<div><p>Never mind. I see that the UTF character code works in
titles.</p></div>Rob Knighttag:help-archives.hannonhill.com,2010-02-09:Comment/395354462016-04-01T20:28:27Z2016-04-01T20:28:27ZTwo hyphens in an asset title breaks a format<div><p>You got it, Rob. You should be able to use the numeric entity to
render an mdash. To confirm, were you able to get things
working?</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/395354462016-04-03T21:10:43Z2016-04-03T21:10:43ZTwo hyphens in an asset title breaks a format<div><p>Do Xalan components need to be enabled in preferences or
anything like that? I've tried to code above and it doesn't work.
It fails silently with no error message, similar to my original
script.</p></div>Rob Knighttag:help-archives.hannonhill.com,2010-02-09:Comment/395354462016-04-03T21:14:39Z2016-04-03T21:14:39ZTwo hyphens in an asset title breaks a format<div><p>I see that they do. We have them enabled in our setup, so I'm
not sure why it isn't working.</p></div>Rob Knighttag:help-archives.hannonhill.com,2010-02-09:Comment/395354462016-04-04T12:33:01Z2016-04-04T12:33:01ZTwo hyphens in an asset title breaks a format<div><p>Hi Rob,</p>
<p>Correct, there is an <strong>Enable Xalan JavaScript</strong>
<a href="http://www.hannonhill.com/kb/System-Preferences/#content-options">system
preference</a> you will want to ensure is checked.</p>
<p>If it is not working, please feel free to attach your Format and
sample XML that is being applied to the Format and I would be happy
to help take a closer look.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/395354462016-04-04T16:34:38Z2016-04-04T16:34:38ZTwo hyphens in an asset title breaks a format<div><p>Here is my XML:</p>
<pre>
<code class="xml"><?xml version="1.0" encoding="UTF-8"?>
<system-index-block name="Last 10 articles" type="content_type" current-time="1459786946747">
<system-page id="d3cd75f18072701764c820a6048685c2">
<name>brca-exchange</name>
<is-published>true</is-published>
<last-published-on>1459782746898</last-published-on>
<last-published-by>stephens</last-published-by>
<title>BRCA Exchange aggregates publicly accessible data on breast cancer genes</title>
<summary>UC Santa Cruz Genomics Institute led development of a web portal for patients, clinicians, and researchers.</summary>
<keywords>Genomics Institute, David Haussler, Benedict Paten, BRCA Exchange, BRCA Challenge, Global Alliance for Genomics and Health, GA4GH</keywords>
<start-date>1459782000000</start-date>
<display-name>BRCA Exchange aggregates publicly accessible data on breast cancer genes</display-name>
<path>/2016/04/brca-exchange</path>
<site>news</site>
<link>site://news/2016/04/brca-exchange</link>
<created-by>stephens</created-by>
<created-on>1459547369657</created-on>
<last-modified-by>stephens</last-modified-by>
<last-modified>1459782727338</last-modified>
<dynamic-metadata>
<name>category-divisions</name>
<value>Engineering</value>
</dynamic-metadata>
<dynamic-metadata>
<name>category-arts</name>
</dynamic-metadata>
<dynamic-metadata>
<name>category-engineering</name>
<value>Biomolecular Engineering</value>
</dynamic-metadata>
<dynamic-metadata>
<name>category-humanities</name>
</dynamic-metadata>
<dynamic-metadata>
<name>category-pbsci</name>
</dynamic-metadata>
<dynamic-metadata>
<name>category-socsci</name>
</dynamic-metadata>
<dynamic-metadata>
<name>category-landing-pages</name>
<value>Research</value>
</dynamic-metadata>
<dynamic-metadata>
<name>category-audience</name>
</dynamic-metadata>
<dynamic-metadata>
<name>category-activity</name>
</dynamic-metadata>
<dynamic-metadata>
<name>category-values</name>
</dynamic-metadata>
<dynamic-metadata>
<name>category-topics</name>
<value>Human Health</value>
<value>Genomics</value>
</dynamic-metadata>
<dynamic-metadata>
<name>category-placement</name>
<value>Secondary Story</value>
</dynamic-metadata>
<dynamic-metadata>
<name>type</name>
<value>Regular News</value>
</dynamic-metadata>
<dynamic-metadata>
<name>category-profile</name>
</dynamic-metadata>
<dynamic-metadata>
<name>site-url</name>
</dynamic-metadata>
<dynamic-metadata>
<name>number-displayed</name>
</dynamic-metadata>
<system-data-structure definition-path="Campus Home Environment/News Article">
<contact>
<name>Tim Stephens</name>
<title />
<phone />
<email>stephens@ucsc.edu</email>
</contact>
<video>
<embed />
<width />
<caption />
</video>
<lead-image>
<image type="file">
<content />
<path>/2016/04/images/global-alliance-400.jpg</path>
<link>site://news/2016/04/images/global-alliance-400.jpg</link>
<site>news</site>
<name>global-alliance-400.jpg</name>
<display-name>global-alliance-400.jpg</display-name>
</image>
<image-alt>Global Alliance logo</image-alt>
<image-thumb type="file">
<content />
<path>/2016/04/images/brca-challenge-thumb.jpg</path>
<link>site://news/2016/04/images/brca-challenge-thumb.jpg</link>
<site>news</site>
<name>brca-challenge-thumb.jpg</name>
<display-name>brca-challenge-thumb.jpg</display-name>
</image-thumb>
<image-thumb-alt>BRCA Challenge logo</image-thumb-alt>
<image-caption />
</lead-image>
<secondary-images>
<image type="file">
<content />
<path>/2016/04/images/brca-exchange-300.jpg</path>
<link>site://news/2016/04/images/brca-exchange-300.jpg</link>
<site>news</site>
<name>brca-exchange-300.jpg</name>
<display-name>brca-exchange-300.jpg</display-name>
</image>
<image-alt>BRCA Exchange logo</image-alt>
<image-caption />
</secondary-images>
<secondary-images>
<image type="file">
<content />
<path>/2015/07/images/benedict-paten-300.jpg</path>
<link>site://news/2015/07/images/benedict-paten-300.jpg</link>
<site>news</site>
<name>benedict-paten-300.jpg</name>
<display-name>benedict-paten-300.jpg</display-name>
</image>
<image-alt>Benedict Paten</image-alt>
<image-caption>Benedict Paten</image-caption>
</secondary-images>
<article-subhead>UC Santa Cruz Genomics Institute led development of the web portal for patients, clinicians, and researchers seeking information on BRCA1 and BRCA2 gene variants</article-subhead>
<article-text>
<p>A team at the
<a href="https://genomics.soe.ucsc.edu/">UC Santa Cruz Genomics Institute</a> working with the BRCA Challenge, a demonstration project of the
<a href="https://genomicsandhealth.org/">Global Alliance for Genomics and Health</a> (GA4GH), has developed an important new resource, the BRCA Exchange web portal, which brings together genomic and clinical data on the genes BRCA1 and BRCA2.
</p>
<p>BRCA1 and BRCA2 are tumor suppressor genes, and certain mutations in them increase the risk of breast, ovarian, and other cancers. They are now among the most thoroughly studied genes in the human genome, and thousands of variants of each gene (versions with small differences in their DNA sequences) have been identified. Some variants are harmless or benign, others are deleterious, and for many variants the clinical significance remains uncertain.</p>
<p>BRCA Challenge is an international effort to advance understanding of these genes and their role in cancer by pooling all of the available genomic and clinical data. Improved understanding of genetic variation in these genes has the potential to improve patient diagnoses and disease prevention.</p>
<p>The BRCA Exchange is the first product of the BRCA Challenge, which released the newest version of the web portal on Sunday, April 3, in advance of the annual meeting of the
<a href="http://www.ichg2016.org/index.html">International Congress of Human Genetics</a> (ICHG) in Kyoto, Japan.
</p>
<p>"As a result of this global effort, we were able to create the largest database of BRCA data in the world, providing a comprehensive resource that people can refer to when they get the results of a genetic test and want to know the clinical significance of particular BRCA gene variants," said UC Santa Cruz research scientist Benedict Paten, who led the Genomics Institute's work on the BRCA Exchange.</p>
<p>
<strong>International collaboration</strong>
</p>
<p>David Haussler, scientific director of the Genomics Institute and a cofounder of the Global Alliance for Genomics and Health, noted that international collaboration is essential to realize the full potential of genomic data. "The BRCA Exchange is a significant milestone in advancing the Global Alliance's mission of enabling the sharing of genomic and clinical data to improve human health," Haussler said.</p>
<p>The BRCA Exchange is a publicly accessible web portal that provides a simple interface for patients, clinicians, and researchers to access curated expert interpretations and some supporting evidence for genetic variants identified in BRCA1 and BRCA2. Since its initial beta launch in October 2015, the BRCA Exchange has supported clinical decision-making by allowing any web user to search all BRCA1 and BRCA2 genetic variants that have been classified by the international
<a href="http://enigmaconsortium.org/">ENIGMA consortium</a> and to easily access the background rationale for classification.
</p>
<p>"The BRCA Challenge project represents the most comprehensive effort to date to pool BRCA variants from multiple international databases as a vehicle to provide supporting evidence for BRCA variant classifications in the public domain," said Amanda Spurdle, chair of the ENIGMA consortium steering committee and Head of the Molecular Cancer Epidemiology Laboratory, QIMR Berghofer Medical Research Institute, Brisbane, Australia.</p>
<p>The new release will include an additional tier that allows web users, after agreeing to a disclaimer and data use policy, to interact with data on genetic variants that have not yet been expert classified and whose clinical significance is therefore not yet understood. This represents the first time that all publicly available BRCA1 and BRCA2 variant data contained in databases such as ClinVar, LOVD, ExAC, and the 1000 Genomes Project have been pooled in a single, federated resource.</p>
<p>
<strong>&amp;#65279;Collective knowledge</strong>
</p>
<p>The exchange allows researchers, clinicians, and others to simultaneously search across the world's collective knowledge on the genes. The updated portal integrates information on more than 13,000 genetic variants from several national databases.</p>
<p>"We are pleased that after such a short period, we have already received feedback from users around the world who have accessed the portal for understanding BRCA1 and BRCA2 variants," said Stephen Chanock, director of the National Cancer Institute's Division of Cancer Epidemiology and Genetics and co-chair of the BRCA Challenge's Steering Committee.</p>
<p>The BRCA Exchange will enable the development of a federated network to share BRCA data using the application programming interface (API) developed by the GA4GH Data Working Group, co-chaired by Haussler. Such technical capabilities, developed in conjunction with members of the BRCA Challenge's Evidence Gathering Group, will allow organizations around the globe to share their data directly with the BRCA Exchange.</p>
<p>"By aggregating genomic and clinical data from around the world, the BRCA Exchange will significantly expand clinical impact because it will allow us to bring together currently siloed datasets to facilitate classifying variants of uncertain significance and resolving those with differing interpretations," said Heidi Rehm, director of the Laboratory for Molecular Medicine at Partners Healthcare and member of the BRCA Challenge's Steering Committee.</p>
<p>Version 1.0 of the BRCA Exchange, which is expected to launch later this year, will offer a third tier of access, visible only to credentialed users. This controlled access space will allow for improved variant classification by aggregating and hosting case-level evidence.</p>
<p>Development of the BRCA Exchange was funded primarily by the U.S. National Institutes of Health through the Center for Big Data in Translational Genomics, a multi-institutional partnership based at UC Santa Cruz.</p>
<p>The Global Alliance for Genomics and Health is an international, non-profit alliance formed to accelerate the potential of genomic medicine to advance human health. Bringing together over 350 leading organizations working in healthcare, research, disease and patient advocacy, life science, and information technology, GA4GH members are working together to create a common framework of tools, methods, and harmonized approaches and supporting demonstration projects to enable the responsible, voluntary, and secure sharing of genomic and clinical data.</p>
</article-text>
<comments />
<show-updated />
<admin>
<audience />
<admin /></admin>
<related-links>
<page>
<path>/</path>
</page>
<symlink>
<path>/</path>
</symlink>
<url>http://</url>
<title />
</related-links>
<profile-content>
<thumb>
<path>/</path>
</thumb>
<thumb-alt />
<title />
<description />
</profile-content>
<events>
<end-date />
</events>
</system-data-structure>
</system-page>
</system-index-block></code>
</pre>
<p>And my XSL format:</p>
<pre>
<code class="xsl"><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="hh" version="1.0" xmlns:hh="http://www.hannonhill.com/XSL/Functions" xmlns:xalan="http://xml.apache.org/xalan">
<xsl:strip-space elements="*"/>
<xsl:include href="/formats/Format Date"/>
<xsl:template match="text()"><xsl:value-of select="normalize-space(.)"/></xsl:template>
<xsl:template match="//system-index-block">
<!--
Must be NO WHITESPACE between <xsl:comment> and #START-ROOT-CODE,
same for #END-ROOT-CODE and </xsl:comment>
-->
<xsl:comment>#protect-top
<xsl:text>latest({</xsl:text>
<xsl:text>"items": [</xsl:text>
<xsl:apply-templates select="//system-page[not(@current)]"/>
<xsl:text>]})</xsl:text>
#protect-top</xsl:comment>
</xsl:template>
<!--
Simple example to output {"name": "system-name", "title": "Title
Metadata"}
-->
<xsl:template match="system-page">
<xsl:text>{"name": "</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>", "title": "</xsl:text>
<xsl:value-of select="hh:replaceDoubleHyphen(string(title))"/>
<xsl:text>", "url": "</xsl:text>
<xsl:text>http://news.ucsc.edu</xsl:text><xsl:value-of select="path"/><xsl:text>.html</xsl:text>
<xsl:text>", "date": "</xsl:text>
<xsl:call-template name="format-date">
<xsl:with-param name="date" select="start-date"/>
<xsl:with-param name="mask">mmmm dd, yyyy</xsl:with-param>
</xsl:call-template>
<xsl:if test="system-data-structure/lead-image/image/path != '/'">
<xsl:text>", "thumbnail": "</xsl:text>
<xsl:text>http://news.ucsc.edu</xsl:text><xsl:value-of select="system-data-structure/lead-image/image-thumb/path"/>
</xsl:if>
<xsl:text>"}</xsl:text>
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:template>
<xalan:component functions="replaceDoubleHyphen" prefix="hh">
<xalan:script lang="javascript">
<![CDATA[
function replaceDoubleHyphen(str) {
return str.replace(/-{2,}/g, '-');
};
]]>
</xalan:script>
</xalan:component>
</xsl:stylesheet></code>
</pre></div>Rob Knighttag:help-archives.hannonhill.com,2010-02-09:Comment/395354462016-04-05T14:00:02Z2016-04-05T14:00:02ZTwo hyphens in an asset title breaks a format<div><p>Hi Rob,</p>
<p>Unfortunately, I was not able to reproduce the issue in my test
instance. After adding a double-hyphen to the sample XML you
provided, I was getting the following which appears to be the
expected output:</p>
<pre>
<code><!--#protect-top
latest({"items": [{"name": "brca-exchange", "title": "BRCA Exchange aggregates publicly accessible data on breast cancer - genes", "url": "http://news.ucsc.edu/2016/04/brca-exchange.html", "date": "1459782000000", "thumbnail": "http://news.ucsc.edu/2016/04/images/brca-challenge-thumb.jpg"}]})
#protect-top--></code>
</pre>
<p>I also tried attaching the XML Block and Format to a page to
make sure it renders and it does.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffith