简体   繁体   English

XHTML 1.0 Transitive,是否有可以重构HTML的工具?

[英]XHTML 1.0 Transitive, is there a tool that can refactor HTML?

I have a Asp.net web application running with the following config setting. 我有一个使用以下配置设置运行的Asp.net Web应用程序。

<xhtmlConformance mode="Legacy"/>

This limits use of AJAX and compatibility with multiple browser. 这限制了AJAX的使用以及与多个浏览器的兼容性。

If my understanding is correct, the HTML code of the aspx pages need to be fixed to comply with XHTML 1.0 Transitional. 如果我的理解是正确的,则需要固定aspx页面的HTML代码以符合XHTML 1.0 Transitional。

There are alot of HTML pages, ~1000, is there a tool that could speed up this process? 有很多HTML页面,大约有1000个,是否有可以加快此过程的工具?

The DMS Software Reengineering Toolkit is a tool for automating mass change to large source code bases. DMS Software Reengineering Toolkit是用于自动将大量更改转换为大型源代码的工具。

DMS uses language-precise parsers to read source code, and langauge-precise analyzers to determine meaning or problems. DMS使用语言精确的解析器读取源代码,并使用语言精确的分析器确定含义或问题。 One can use Source to Source program transformations to carry out changes of the form, "if you see this , replace it by that " stated in terms of language surface syntax. 我们可以使用源对源程序变换开展形式的变化,“如果你看到这一点 ,通过替换它,”在语言的表层语法方面的规定。 The patterns are driven by the language grammar and are applied to ASTs generated by DMS parsers. 模式由语言语法驱动,并应用于DMS解析器生成的AST。

DMS has language front ends for a variety of languages, including HMTL and XHTML. DMS具有用于多种语言的语言前端,包括HMTL和XHTML。

DMS has been used on "dirty" HTML (even that has a precise definition!) to refactor it. DMS已在“肮脏的” HTML(甚至具有精确的定义!)上使用,以对其进行重构。 It might be a pretty good match for your fix-1000-pages problem. 它可能非常适合您的fix-1000页面问题。

Are the pages currently in HTML or XHTML? 页面当前是HTML还是XHTML? If they are in HTML, leave them . 如果它们是HTML格式, 请保留它们 There is no benefit to using XHTML. 使用XHTML没有任何好处。

HTML 5 supports the use of XML syntax so moving from legacy HTML to XHTML is going to have some long term advantages since you pages will be syntactically correct which could allow for an easier move to HTML 5 or XHTML 2 when they are completed. HTML 5支持使用XML语法,因此从旧版HTML过渡到XHTML将具有一些长期优势,因为您的页面在语法上是正确的,这可以使完成后的页面更轻松地过渡到HTML 5或XHTML 2。

As noted by David Dorward in his answer, HTML Tidy might be useful if you have fairly constant HTML markup, but given the number of pages I would be surprised if that was the case. 正如David Dorward在他的回答中指出的那样,如果您具有相当恒定的HTML标记,则HTML Tidy可能会很有用,但是鉴于这种情况下的页面数,我会感到惊讶。 If you do a Google search for " legacy html to xhtml tool " some other tools turnup that might be worth looking into. 如果您用Google搜索“从html到xhtml的旧版HTML工具 ”,其他一些值得关注的工具。

Another thing to take into account is how the pages are written. 要考虑的另一件事是页面的编写方式。 Most legacy HTML pages don't have a clear separation between markup and styles so you are likely going to have to pull styling out for CSS files that automatic tools can be hit or miss with. 大多数旧版HTML页面在标记和样式之间并没有明确的区分,因此您可能不得不为自动工具可能会碰到的CSS文件拉出样式。 As such, you might be looking at a situation where the best thing to do is sit down with the site and run the pages though a validator such as the W3C Markup Validation Service or use a browser plug-in to do the testing while you are browsing through the site. 因此,您可能正在考虑的一种情况中,最好的方法是坐在网站上并通过诸如W3C标记验证服务之类的验证器运行页面,或者在您正在使用时使用浏览器插件进行测试浏览网站。 The Html Validator for Firefox is pretty good and this is generally how I test web applications. 适用于Firefox的HTML验证程序非常好,这通常就是我测试Web应用程序的方式。 The downside to this that if there is any HTML that is being generated in the code-behind pages, you may not encounter it during testing. 不利的一面是,如果在代码隐藏页面中正在生成任何HTML,则在测试过程中可能不会遇到它。

Tidy可能是目前最好的,但是我从来没有完全满意过,如果代码那么糟糕,通常表明它仍然需要重写。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 验证(XHTML 1.0 Transitional):元素&#39;html&#39;不能嵌套在元素&#39;div&#39;中 - Validation (XHTML 1.0 Transitional): Element 'html' cannot be nested within element 'div' 为什么select标记至少需要在子代上才有效xhtml 1.0 - Why the select tag need at least on child to be xhtml 1.0 valid ASP.NET 2.0 / 3.5中的XHTML 1.0严格(或过渡)合规性 - XHTML 1.0 Strict (or Transitional) compliance in ASP.NET 2.0/3.5 验证不会显示错误字幕xhtml1.0 - marque will not displayed error comes as validation xhtml1.0 剃刀显示模板未通过XHTML 1.0过渡验证 - Razor display template fails XHTML 1.0 Transitional validation 将文档类型从XHTML更改为HTML5 - Changing doctype from XHTML to HTML5 如何将这两种方法重构为1种? - How can I refactor these 2 methods into 1? ASP.NET BulletedList禁用的项目与XHTML 1.0 Strict DOCTYPE不兼容 - ASP.NET BulletedList disabled item not compliant with XHTML 1.0 Strict DOCTYPE 我是否需要将 MetaTag http-equiv 与 DTD XHTML 1.0 Transitional//EN 一起使用? - Do I need to use MetaTag http-equiv with DTD XHTML 1.0 Transitional//EN? 验证(XHTML 1.0 Transitional):此名称包含大写字符,不允许使用。 - Validation (XHTML 1.0 Transitional): This name contains uppercase characters, which is not allowed.
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM