@Test public void namespaced_element() { Resource resource = getResource("namespaced_element.tml"); ComponentTemplate template = getParser().parseTemplate(resource); assertSame(template.getResource(), resource); List<TemplateToken> tokens = template.getTokens(); assertEquals(tokens.size(), 8); StartElementToken t0 = get(tokens, 0); String expectedURI = "http: assertEquals(t0.namespaceURI, expectedURI); assertEquals(t0.name, "bar"); DefineNamespacePrefixToken t1 = get(tokens, 1); assertEquals(t1.namespacePrefix, "foo"); assertEquals(t1.namespaceURI, expectedURI); AttributeToken t2 = get(tokens, 2); assertEquals(t2.name, "biff"); assertEquals(t2.value, "baz"); assertEquals(t2.namespaceURI, expectedURI); StartElementToken t4 = get(tokens, 4); assertEquals(t4.namespaceURI, ""); assertEquals(t4.name, "gnip"); }
public ComponentTemplate parseTemplate(final Resource templateResource) { if (!templateResource.exists()) throw new RuntimeException(String.format("Template resource %s does not exist.", templateResource)); return tracker.invoke("Parsing component template " + templateResource, new Invokable<ComponentTemplate>() { public ComponentTemplate invoke() { return new SaxTemplateParser(templateResource, configuration).parse(defaultCompressWhitespace); } }); }
TemplateParserImpl implements TemplateParser { public ComponentTemplate parseTemplate(final Resource templateResource) { if (!templateResource.exists()) throw new RuntimeException(String.format("Template resource %s does not exist.", templateResource)); return tracker.invoke("Parsing component template " + templateResource, new Invokable<ComponentTemplate>() { public ComponentTemplate invoke() { return new SaxTemplateParser(templateResource, configuration).parse(defaultCompressWhitespace); } }); } }
TemplateParserImpl implements TemplateParser { public ComponentTemplate parseTemplate(final Resource templateResource) { if (!templateResource.exists()) throw new RuntimeException(String.format("Template resource %s does not exist.", templateResource)); return tracker.invoke("Parsing component template " + templateResource, new Invokable<ComponentTemplate>() { public ComponentTemplate invoke() { return new SaxTemplateParser(templateResource, configuration).parse(defaultCompressWhitespace); } }); } TemplateParserImpl(Map<String, URL> configuration,

                              @Symbol(SymbolConstants.COMPRESS_WHITESPACE)
                              boolean defaultCompressWhitespace, OperationTracker tracker); }
TemplateParserImpl implements TemplateParser { public ComponentTemplate parseTemplate(final Resource templateResource) { if (!templateResource.exists()) throw new RuntimeException(String.format("Template resource %s does not exist.", templateResource)); return tracker.invoke("Parsing component template " + templateResource, new Invokable<ComponentTemplate>() { public ComponentTemplate invoke() { return new SaxTemplateParser(templateResource, configuration).parse(defaultCompressWhitespace); } }); } TemplateParserImpl(Map<String, URL> configuration,

                              @Symbol(SymbolConstants.COMPRESS_WHITESPACE)
                              boolean defaultCompressWhitespace, OperationTracker tracker); ComponentTemplate parseTemplate(final Resource templateResource); Map<String, URL> getDTDURLMappings(); }
TemplateParserImpl implements TemplateParser { public ComponentTemplate parseTemplate(final Resource templateResource) { if (!templateResource.exists()) throw new RuntimeException(String.format("Template resource %s does not exist.", templateResource)); return tracker.invoke("Parsing component template " + templateResource, new Invokable<ComponentTemplate>() { public ComponentTemplate invoke() { return new SaxTemplateParser(templateResource, configuration).parse(defaultCompressWhitespace); } }); } TemplateParserImpl(Map<String, URL> configuration,

                              @Symbol(SymbolConstants.COMPRESS_WHITESPACE)
                              boolean defaultCompressWhitespace, OperationTracker tracker); ComponentTemplate parseTemplate(final Resource templateResource); Map<String, URL> getDTDURLMappings();  }