Author: hlship
Date: Wed Apr 18 05:22:18 2007
New Revision: 529997
URL: http://svn.apache.org/viewvc?view=rev&rev=529997
Log:
TAPESTRY-1264: Can't specify DOCTYPE in template
Added:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/dom/DTD.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/parser/DTDToken.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/DTDPageElement.java
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/components/
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/components/SimpleLayout.java
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/DTDFromComponent.java
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/DTDFromPage.java
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/MultipleDTD.java
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/NoDTD.java
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/pagelevel/DTDTest.java
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/SimpleLayoutComponent.java
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/components/
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/components/SimpleLayout.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/DTDFromComponent.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/DTDFromPage.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/MultipleDTD.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/NoDTD.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/simple.dtd
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/system_doctype.xml
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/dom/Document.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/parser/TokenType.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageElementFactory.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageElementFactoryImpl.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageMarkupRendererImpl.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/TemplateParserImpl.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/PageImpl.java
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/dom/DOMTest.java
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/TemplateParserImplTest.java
Added:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/dom/DTD.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/dom/DTD.java?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/dom/DTD.java
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/dom/DTD.java
Wed Apr 18 05:22:18 2007
@@ -0,0 +1,71 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.dom;
+
+import java.io.PrintWriter;
+
+/**
+ * Representation of a document type. Note that technically, a Doctype isn't a
node in an xml
+ * document; hence this doesn't extend node.
+ */
+public class DTD
+{
+ private final String _name;
+
+ private final String _publicId;
+
+ private final String _systemId;
+
+ public DTD(String name, String publicId, String systemId)
+ {
+ _name = name;
+ _publicId = publicId;
+ _systemId = systemId;
+ }
+
+ public String getName()
+ {
+ return _name;
+ }
+
+ public String getPublicId()
+ {
+ return _publicId;
+ }
+
+ public String getSystemId()
+ {
+ return _systemId;
+ }
+
+ public void toMarkup(PrintWriter writer)
+ {
+ if (_publicId != null)
+ {
+ if (_systemId != null)
+ {
+ writer.printf("<!DOCTYPE %s PUBLIC \"%s\" \"%s\">", _name,
_publicId, _systemId);
+ }
+ else
+ {
+ writer.printf("<!DOCTYPE %s PUBLIC \"%s\">", _name, _publicId);
+ }
+ }
+ else if (_systemId != null)
+ {
+ writer.printf("<!DOCTYPE %s SYSTEM \"%s\">", _name, _systemId);
+ }
+ }
+}
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/dom/Document.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/dom/Document.java?view=diff&rev=529997&r1=529996&r2=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/dom/Document.java
(original)
+++
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/dom/Document.java
Wed Apr 18 05:22:18 2007
@@ -1,4 +1,4 @@
-// Copyright 2006 The Apache Software Foundation
+// Copyright 2006, 2007 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -25,6 +25,8 @@
{
private Element _rootElement;
+ private DTD _dtd;
+
private final MarkupModel _model;
public Document(MarkupModel model)
@@ -50,15 +52,13 @@
{
Defense.notBlank(path, "path");
- if (_rootElement == null)
- return null;
+ if (_rootElement == null) return null;
int slashx = path.indexOf("/");
String rootElementName = slashx < 0 ? path : path.substring(0, slashx);
- if (!_rootElement.getName().equals(rootElementName))
- return null;
+ if (!_rootElement.getName().equals(rootElementName)) return null;
return slashx < 0 ? _rootElement :
_rootElement.find(path.substring(slashx + 1));
}
@@ -88,15 +88,18 @@
if (_rootElement == null)
throw new IllegalStateException("No root element has been
defined.");
- // TODO: XML declaration, plus lead-in comments, directives, DOCTYPE.
+ // TODO: XML declaration, plus lead-in comments, directives.
+ if (_dtd != null)
+ {
+ _dtd.toMarkup(writer);
+ }
_rootElement.toMarkup(writer);
}
@Override
public String toString()
{
- if (_rootElement == null)
- return "[empty Document]";
+ if (_rootElement == null) return "[empty Document]";
return super.toString();
}
@@ -117,4 +120,10 @@
{
return _rootElement.getElementById(id);
}
+
+ public void dtd(String name, String publicId, String systemId)
+ {
+ _dtd = new DTD(name, publicId, systemId);
+ }
+
}
Added:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/parser/DTDToken.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/parser/DTDToken.java?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/parser/DTDToken.java
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/parser/DTDToken.java
Wed Apr 18 05:22:18 2007
@@ -0,0 +1,64 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.internal.parser;
+
+import org.apache.tapestry.ioc.Location;
+
+/**
+ * Represents the presence of a Document Type declaration within a template.
The Document type
+ * declaration will be output to the client. In the event that multiple
declarations are encountered
+ * (a page and one or more nested components all declare a document type), the
first document type
+ * declared will be used.
+ */
+public class DTDToken extends TemplateToken
+{
+ private final String _name;
+
+ private final String _publicId;
+
+ private final String _systemId;
+
+ public DTDToken(String name, String publicId, String systemId, Location
location)
+ {
+ super(TokenType.DTD, location);
+
+ _name = name;
+ _publicId = publicId;
+ _systemId = systemId;
+ }
+
+ /** Returns the doctype name (the name of the document root element) */
+ public String getName()
+ {
+ return _name;
+ }
+
+ /** Returns the public identifier of the DTD */
+ public String getPublicId()
+ {
+ return _publicId;
+ }
+
+ /** Returns the system identifier of the DTD */
+ public String getSystemId()
+ {
+ return _systemId;
+ }
+
+ public String toString()
+ {
+ return String.format("DTD[name=%s; publicId=%s; systemId=%s]", _name,
_publicId, _systemId);
+ }
+}
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/parser/TokenType.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/parser/TokenType.java?view=diff&rev=529997&r1=529996&r2=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/parser/TokenType.java
(original)
+++
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/parser/TokenType.java
Wed Apr 18 05:22:18 2007
@@ -1,4 +1,4 @@
-// Copyright 2006 The Apache Software Foundation
+// Copyright 2006, 2007 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -20,5 +20,5 @@
*/
public enum TokenType {
- ATTRIBUTE, CDATA, COMMENT, END_ELEMENT, START_COMPONENT, START_ELEMENT,
TEXT, BODY, EXPANSION, PARAMETER, BLOCK
+ ATTRIBUTE, CDATA, COMMENT, END_ELEMENT, START_COMPONENT, START_ELEMENT,
TEXT, BODY, EXPANSION, PARAMETER, BLOCK, DTD
}
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageElementFactory.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageElementFactory.java?view=diff&rev=529997&r1=529996&r2=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageElementFactory.java
(original)
+++
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageElementFactory.java
Wed Apr 18 05:22:18 2007
@@ -1,4 +1,4 @@
-// Copyright 2006 The Apache Software Foundation
+// Copyright 2006, 2007 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
import org.apache.tapestry.annotations.Component;
import org.apache.tapestry.internal.parser.AttributeToken;
import org.apache.tapestry.internal.parser.CommentToken;
+import org.apache.tapestry.internal.parser.DTDToken;
import org.apache.tapestry.internal.parser.ExpansionToken;
import org.apache.tapestry.internal.parser.StartElementToken;
import org.apache.tapestry.internal.parser.TextToken;
@@ -108,4 +109,6 @@
/** Creates a new element from the token. */
PageElement newCommentElement(CommentToken token);
+
+ PageElement newDTDElement(DTDToken token);
}
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageElementFactoryImpl.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageElementFactoryImpl.java?view=diff&rev=529997&r1=529996&r2=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageElementFactoryImpl.java
(original)
+++
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageElementFactoryImpl.java
Wed Apr 18 05:22:18 2007
@@ -20,6 +20,7 @@
import org.apache.tapestry.TapestryConstants;
import org.apache.tapestry.internal.parser.AttributeToken;
import org.apache.tapestry.internal.parser.CommentToken;
+import org.apache.tapestry.internal.parser.DTDToken;
import org.apache.tapestry.internal.parser.ExpansionToken;
import org.apache.tapestry.internal.parser.StartElementToken;
import org.apache.tapestry.internal.parser.TextToken;
@@ -27,6 +28,7 @@
import org.apache.tapestry.internal.structure.CommentPageElement;
import org.apache.tapestry.internal.structure.ComponentPageElement;
import org.apache.tapestry.internal.structure.ComponentPageElementImpl;
+import org.apache.tapestry.internal.structure.DTDPageElement;
import org.apache.tapestry.internal.structure.ExpansionPageElement;
import org.apache.tapestry.internal.structure.Page;
import org.apache.tapestry.internal.structure.PageElement;
@@ -168,8 +170,7 @@
{
// Container may be null for a root element;
- if (container == null)
- return;
+ if (container == null) return;
ComponentResources resources = container.getComponentResources();
@@ -239,5 +240,10 @@
public PageElement newCommentElement(CommentToken token)
{
return new CommentPageElement(token.getComment());
+ }
+
+ public PageElement newDTDElement(DTDToken token)
+ {
+ return new DTDPageElement(token.getName(), token.getPublicId(),
token.getSystemId());
}
}
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java?view=diff&rev=529997&r1=529996&r2=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java
(original)
+++
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java
Wed Apr 18 05:22:18 2007
@@ -31,6 +31,7 @@
import org.apache.tapestry.internal.parser.BodyToken;
import org.apache.tapestry.internal.parser.CommentToken;
import org.apache.tapestry.internal.parser.ComponentTemplate;
+import org.apache.tapestry.internal.parser.DTDToken;
import org.apache.tapestry.internal.parser.EndElementToken;
import org.apache.tapestry.internal.parser.ExpansionToken;
import org.apache.tapestry.internal.parser.ParameterToken;
@@ -71,6 +72,8 @@
private boolean _addAttributesAsComponentBindings = false;
+ private boolean _dtdAdded;
+
private final BindingSource _bindingSource;
private final Stack<BodyPageElement> _bodyPageElementStack = newStack();
@@ -455,6 +458,10 @@
parameter((ParameterToken) token);
break;
+ case DTD:
+ dtd((DTDToken) token);
+ break;
+
default:
throw new IllegalStateException("Not implemented yet: " +
token);
}
@@ -506,8 +513,7 @@
String id = token.getId();
- if (id != null)
- _loadingElement.addBlock(id, block);
+ if (id != null) _loadingElement.addBlock(id, block);
setupBlock(block);
}
@@ -525,8 +531,7 @@
// We know that if embeddedId is null, embeddedType is not.
- if (embeddedId == null)
- embeddedId = generateEmbeddedId(embeddedType, _idAllocator);
+ if (embeddedId == null) embeddedId = generateEmbeddedId(embeddedType,
_idAllocator);
EmbeddedComponentModel embeddedModel = _loadingComponentModel
.getEmbeddedComponentModel(embeddedId);
@@ -627,6 +632,21 @@
PageElement element = _pageElementFactory.newTextElement(token);
addToBody(element);
+ }
+
+ private void dtd(DTDToken token)
+ {
+ // first DTD encountered wins.
+ if (_dtdAdded) return;
+
+ PageElement element = _pageElementFactory.newDTDElement(token);
+ // since rendering via the markup writer is to the document tree,
+ // we don't really care where this gets placed in the tree; the
+ // DTDPageElement will set the dtd of the document directly, rather
than
+ // writing anything to the markup writer
+ _page.getRootElement().addToTemplate(element);
+
+ _dtdAdded = true;
}
/** Works the component queue, until exausted. */
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageMarkupRendererImpl.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageMarkupRendererImpl.java?view=diff&rev=529997&r1=529996&r2=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageMarkupRendererImpl.java
(original)
+++
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageMarkupRendererImpl.java
Wed Apr 18 05:22:18 2007
@@ -1,4 +1,4 @@
-// Copyright 2006 2007 The Apache Software Foundation
+// Copyright 2006 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/TemplateParserImpl.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/TemplateParserImpl.java?view=diff&rev=529997&r1=529996&r2=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/TemplateParserImpl.java
(original)
+++
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/TemplateParserImpl.java
Wed Apr 18 05:22:18 2007
@@ -33,6 +33,7 @@
import org.apache.tapestry.internal.parser.CommentToken;
import org.apache.tapestry.internal.parser.ComponentTemplate;
import org.apache.tapestry.internal.parser.ComponentTemplateImpl;
+import org.apache.tapestry.internal.parser.DTDToken;
import org.apache.tapestry.internal.parser.EndElementToken;
import org.apache.tapestry.internal.parser.ExpansionToken;
import org.apache.tapestry.internal.parser.ParameterToken;
@@ -132,7 +133,6 @@
_insideBody = false;
_insideBodyErrorLogged = false;
_ignoreEvents = true;
-
}
public ComponentTemplate parseTemplate(Resource templateResource)
@@ -567,6 +567,20 @@
public void startDTD(String name, String publicId, String systemId) throws
SAXException
{
+ //notes:
+ //1) a DTD has to occur at the very start of a document. Since we
don't start
+ //recording characters until we hit the first element of a document
(see
+ //characters and startElement), there should be no text to process.
+ //It's worth noting that the sax parser will puke if any of the
following
+ //occur:
+ // 1) a doctype is encountered multiple times in the same document
+ // 2) a doctype is encountered anywhere other than the very first item
+ // in a document.
+ // Hence, the assumption made in 1 should hold.
+ //Since an exception is thrown for case #1 above, we can just add the
DTDToken.
+ //When we go to process the token (in PageLoaderProcessor), we can
make sure
+ //that the final page has only a single DTDToken (the first one).
+ _tokens.add(new DTDToken(name,publicId,systemId,getCurrentLocation()));
}
public void startEntity(String name) throws SAXException
Added:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/DTDPageElement.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/DTDPageElement.java?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/DTDPageElement.java
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/DTDPageElement.java
Wed Apr 18 05:22:18 2007
@@ -0,0 +1,49 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/*
+ * Created on Mar 15, 2007
+ *
+ *
+ */
+package org.apache.tapestry.internal.structure;
+
+import org.apache.tapestry.MarkupWriter;
+import org.apache.tapestry.runtime.RenderQueue;
+
+public class DTDPageElement implements PageElement
+{
+
+ private final String _name;
+ private final String _publicId;
+ private final String _systemId;
+
+ public DTDPageElement(String name, String publicId, String systemId)
+ {
+ _name=name;
+ _publicId=publicId;
+ _systemId=systemId;
+ }
+
+ public void render(MarkupWriter writer, RenderQueue queue)
+ {
+ writer.getDocument().dtd(_name, _publicId, _systemId);
+ }
+
+ @Override
+ public String toString() {
+ return String.format("DTD[name=%s; publicId=%s;
systemId=%s]",_name,_publicId,_systemId);
+ }
+
+}
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/PageImpl.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/PageImpl.java?view=diff&rev=529997&r1=529996&r2=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/PageImpl.java
(original)
+++
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/PageImpl.java
Wed Apr 18 05:22:18 2007
@@ -191,5 +191,5 @@
{
_dirtyCount++;
}
-
+
}
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/dom/DOMTest.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/dom/DOMTest.java?view=diff&rev=529997&r1=529996&r2=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/dom/DOMTest.java
(original)
+++
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/dom/DOMTest.java
Wed Apr 18 05:22:18 2007
@@ -326,4 +326,39 @@
assertEquals(root.toString(), "<fred><em>< ></em></fred>");
}
+
+ @Test
+ public void dtd_with_markup()
+ {
+ Document d = new Document(new XMLMarkupModel());
+ Element root = d.newRootElement("prime");
+ root.element("slag");
+ d.dtd("prime", "-//TF", "tf");
+ String expected = "<!DOCTYPE prime PUBLIC \"-//TF\"
\"tf\"><prime><slag/></prime>";
+ assertEquals(d.toString(),expected);
+ }
+
+ @Test
+ public void dtd_with_nullids() {
+ Document d = new Document(new XMLMarkupModel());
+ d.newRootElement("prime");
+ d.dtd("prime", null, null);
+ assertEquals
+ (
+ d.toString(),
+ "<prime/>"
+ );
+ d.dtd("prime", "-//TF", null);
+ assertEquals(
+ d.toString(),
+ "<!DOCTYPE prime PUBLIC \"-//TF\"><prime/>"
+ );
+
+ d.dtd("prime", null, "tf");
+ assertEquals
+ (
+ d.toString(),
+ "<!DOCTYPE prime SYSTEM \"tf\"><prime/>"
+ );
+ }
}
Added:
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/components/SimpleLayout.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/components/SimpleLayout.java?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/components/SimpleLayout.java
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/components/SimpleLayout.java
Wed Apr 18 05:22:18 2007
@@ -0,0 +1,20 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.integration.app2.components;
+
+public class SimpleLayout
+{
+
+}
Added:
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/DTDFromComponent.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/DTDFromComponent.java?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/DTDFromComponent.java
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/DTDFromComponent.java
Wed Apr 18 05:22:18 2007
@@ -0,0 +1,20 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.integration.app2.pages;
+
+public class DTDFromComponent
+{
+
+}
Added:
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/DTDFromPage.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/DTDFromPage.java?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/DTDFromPage.java
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/DTDFromPage.java
Wed Apr 18 05:22:18 2007
@@ -0,0 +1,20 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.integration.app2.pages;
+
+public class DTDFromPage
+{
+
+}
Added:
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/MultipleDTD.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/MultipleDTD.java?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/MultipleDTD.java
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/MultipleDTD.java
Wed Apr 18 05:22:18 2007
@@ -0,0 +1,20 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.integration.app2.pages;
+
+public class MultipleDTD
+{
+
+}
Added:
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/NoDTD.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/NoDTD.java?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/NoDTD.java
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app2/pages/NoDTD.java
Wed Apr 18 05:22:18 2007
@@ -0,0 +1,20 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.integration.app2.pages;
+
+public class NoDTD
+{
+
+}
Added:
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/pagelevel/DTDTest.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/pagelevel/DTDTest.java?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/pagelevel/DTDTest.java
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/pagelevel/DTDTest.java
Wed Apr 18 05:22:18 2007
@@ -0,0 +1,93 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.integration.pagelevel;
+
+import org.apache.tapestry.dom.Document;
+import org.apache.tapestry.test.pagelevel.PageTester;
+import org.testng.Assert;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+public class DTDTest extends Assert
+{
+ private static final String FRAMESET = "<!DOCTYPE html PUBLIC
\"-//W3C//DTD XHTML 1.0 Frameset//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">";
+
+ private static final String TRANSITIONAL = "<!DOCTYPE html PUBLIC
\"-//W3C//DTD XHTML 1.0 Transitional//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
+
+ private static final String STRICT = "<!DOCTYPE html PUBLIC \"-//W3C//DTD
XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
+
+ @DataProvider(name = "dtd_page_provider")
+ public Object[][] dtd_page_provider()
+ {
+ return new Object[][]
+ {
+ { "DTDFromPage", FRAMESET, "slagheap", },
+ { "DTDFromComponent", TRANSITIONAL, "flubber", },
+ { "MultipleDTD", STRICT, "blubber", },
+ { "NoDTD", "", "no_dtd_loser", } };
+ }
+
+ @Test(dataProvider = "dtd_page_provider")
+ public void verify_correct_dtds(String pageName, String expectedDTD,
String checkText)
+ {
+ String appPackage = "org.apache.tapestry.integration.app2";
+ String appName = "";
+ PageTester tester = new PageTester(appPackage, appName);
+ Document doc = tester.renderPage(pageName);
+ String txt = doc.toString();
+ // use startsWith to make sure the DTD is getting into the right spot.
+ assertTrue(txt.startsWith(expectedDTD));
+ // we should also make sure that the other DTD's don't appear anywhere
else...
+ checkOtherDTD(txt, expectedDTD);
+ // spot check the body of the pages to make sure they correctly
rendered...
+ // they should have, based on the unit tests for template rendering,
but...
+ assertTrue(txt.contains(checkText));
+
+ }
+
+ private void checkOtherDTD(String txt, String expected)
+ {
+ if (expected.equals(TRANSITIONAL))
+ {
+ check(txt, FRAMESET, STRICT);
+ }
+ else if (expected.equals(FRAMESET))
+ {
+ check(txt, STRICT, TRANSITIONAL);
+ ;
+ }
+ else if (expected.equals(STRICT))
+ {
+ check(txt, FRAMESET, TRANSITIONAL);
+ }
+ else if (expected.equals(""))
+ {
+ check(txt, FRAMESET, STRICT, TRANSITIONAL);
+ }
+ else
+ {
+ throw new RuntimeException("Unknown expected string: " + expected);
+ }
+ }
+
+ private void check(String txt, String... invalids)
+ {
+ for (String invalid : invalids)
+ {
+ assertFalse(txt.contains(invalid));
+ }
+ }
+
+}
Added:
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/SimpleLayoutComponent.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/SimpleLayoutComponent.java?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/SimpleLayoutComponent.java
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/SimpleLayoutComponent.java
Wed Apr 18 05:22:18 2007
@@ -0,0 +1,25 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/*
+ * Created on Mar 15, 2007
+ *
+ *
+ */
+package org.apache.tapestry.internal.services;
+
+public class SimpleLayoutComponent
+{
+
+}
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/TemplateParserImplTest.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/TemplateParserImplTest.java?view=diff&rev=529997&r1=529996&r2=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/TemplateParserImplTest.java
(original)
+++
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/TemplateParserImplTest.java
Wed Apr 18 05:22:18 2007
@@ -27,6 +27,7 @@
import org.apache.tapestry.internal.parser.CDATAToken;
import org.apache.tapestry.internal.parser.CommentToken;
import org.apache.tapestry.internal.parser.ComponentTemplate;
+import org.apache.tapestry.internal.parser.DTDToken;
import org.apache.tapestry.internal.parser.EndElementToken;
import org.apache.tapestry.internal.parser.ExpansionToken;
import org.apache.tapestry.internal.parser.ParameterToken;
@@ -575,11 +576,11 @@
}
catch (TapestryException ex)
{
- if (!ex.getMessage().contains(errorMessageSubstring))
- {
- throw new AssertionError(format("Message [%s] does not contain
substring [%s].", ex
- .getMessage(), errorMessageSubstring));
- }
+ if (!ex.getMessage().contains(errorMessageSubstring)) { throw new
AssertionError(
+ format(
+ "Message [%s] does not contain substring [%s].",
+ ex.getMessage(),
+ errorMessageSubstring)); }
assertEquals(ex.getLocation().getLine(), expectedLine);
}
@@ -599,9 +600,36 @@
public void doctype_parsed_correctly(String fileName) throws Exception
{
List<TemplateToken> tokens = tokens(fileName);
- assertEquals(tokens.size(), 10);
- TextToken t = get(tokens, 7);
+ assertEquals(tokens.size(), 11);
+ TextToken t = get(tokens, 8);
assertEquals(t.getText().trim(), "<Test>");
+ }
+
+ @DataProvider(name = "doctype_added_correctly_data")
+ public Object[][] doctype_token_added_correctly_data()
+ {
+ return new Object[][]
+ {
+ { "xhtml1_strict_doctype.html", "html", "-//W3C//DTD XHTML 1.0
Strict//EN",
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" },
+ { "xhtml1_transitional_doctype.html", "html",
+ "-//W3C//DTD XHTML 1.0 Transitional//EN",
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" },
+ { "xhtml1_frameset_doctype.html", "html", "-//W3C//DTD XHTML
1.0 Frameset//EN",
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"
},
+ { "system_doctype.xml", "foo", null,
+
"src/test/resources/org/apache/tapestry/internal/services/simple.dtd" }, };
+ }
+
+ @Test(dataProvider = "doctype_added_correctly_data")
+ public void doctype_added_correctly(String fileName, String name, String
publicId,
+ String systemId) throws Exception
+ {
+ List<TemplateToken> tokens = tokens(fileName);
+ DTDToken t2 = get(tokens, 0);
+ assertEquals(t2.getName(), name);
+ assertEquals(t2.getPublicId(), publicId);
+ assertEquals(t2.getSystemId(), systemId);
}
}
Added:
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/components/SimpleLayout.html
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/components/SimpleLayout.html?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/components/SimpleLayout.html
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/components/SimpleLayout.html
Wed Apr 18 05:22:18 2007
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+ <head>
+ <title>Foo</title>
+ </head>
+ <body>
+ <t:body />
+ </body>
+</html>
\ No newline at end of file
Added:
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/DTDFromComponent.html
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/DTDFromComponent.html?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/DTDFromComponent.html
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/DTDFromComponent.html
Wed Apr 18 05:22:18 2007
@@ -0,0 +1,3 @@
+<html t:type="SimpleLayout"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+ flubber
+</html>
\ No newline at end of file
Added:
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/DTDFromPage.html
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/DTDFromPage.html?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/DTDFromPage.html
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/DTDFromPage.html
Wed Apr 18 05:22:18 2007
@@ -0,0 +1,12 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+<html>
+ <head>
+ <title>
+ DTDFromPage
+ </title>
+ </head>
+ <body>
+ slagheap
+ </body>
+</html>
\ No newline at end of file
Added:
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/MultipleDTD.html
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/MultipleDTD.html?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/MultipleDTD.html
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/MultipleDTD.html
Wed Apr 18 05:22:18 2007
@@ -0,0 +1,5 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html t:type="SimpleLayout"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+ blubber
+</html>
\ No newline at end of file
Added:
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/NoDTD.html
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/NoDTD.html?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/NoDTD.html
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/NoDTD.html
Wed Apr 18 05:22:18 2007
@@ -0,0 +1,10 @@
+<html>
+ <head>
+ <title>
+ NoDTD
+ </title>
+ </head>
+ <body>
+ no_dtd_loser
+ </body>
+</html>
\ No newline at end of file
Added:
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/simple.dtd
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/simple.dtd?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/simple.dtd
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/simple.dtd
Wed Apr 18 05:22:18 2007
@@ -0,0 +1 @@
+<!ELEMENT foo (#PCDATA)>
\ No newline at end of file
Added:
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/system_doctype.xml
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/system_doctype.xml?view=auto&rev=529997
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/system_doctype.xml
(added)
+++
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/system_doctype.xml
Wed Apr 18 05:22:18 2007
@@ -0,0 +1,18 @@
+<!DOCTYPE foo SYSTEM
"src/test/resources/org/apache/tapestry/internal/services/simple.dtd" >
+<!--
+ Copyright 2007 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<foo>bar</foo>
\ No newline at end of file