Update of /var/cvs/html/mmbase/components/core
In directory james.mmbase.org:/tmp/cvs-serv2244

Modified Files:
        cite.jspx 
Log Message:
added some stuff to syntax highlight xml's


See also: http://cvs.mmbase.org/viewcvs/html/mmbase/components/core


Index: cite.jspx
===================================================================
RCS file: /var/cvs/html/mmbase/components/core/cite.jspx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- cite.jspx   4 Aug 2008 21:27:03 -0000       1.1
+++ cite.jspx   4 Aug 2008 21:53:42 -0000       1.2
@@ -4,15 +4,27 @@
     id="${requestScope.componentId}"
     xmlns="http://www.w3.org/1999/xhtml";
     xmlns:c="http://java.sun.com/jsp/jstl/core";
+    xmlns:fn="http://java.sun.com/jsp/jstl/functions";
     xmlns:jsp="http://java.sun.com/JSP/Page";
     xmlns:mm="http://www.mmbase.org/mmbase-taglib-2.0";>
   <jsp:output omit-xml-declaration="true" />
 
   <mm:may action="view_source">
     <mm:import externid="page" required="true" />
+    <mm:import externid="xml">${fn:endsWith(page, '.xml')}</mm:import>
+    <c:choose>
+      <c:when test="${xml eq true}">
+        <mm:formatter xslt="xslt/xmlverbatim.xsl" escape="none">
+          <mm:include cite="true" page="$page" />
+        </mm:formatter>
+      </c:when>
+      <c:otherwise>
     <pre>
-      <mm:include cite="true" page="$page" escape="text/xml"/>
+          <mm:include cite="true" page="$page" escape="text/xml" />
     </pre>
+      </c:otherwise>
+    </c:choose>
+
   </mm:may>
   <mm:may action="view_source" inverse="true">
     <p>You are not allowed to view source</p>
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to