Document your code - Whether its documenting a Web Service API or documenting a simple class, document as you go.
编写文档。无论是Web服务的API,还是一个简单的类,你尽量编写相应文档。
Within it, your code has access to virtually all items and properties of a particular document.
使用这个标签,您的代码可以访问一个特定文档的所有项目和属性。
You'd probably develop this code in a separate file so that you could test it out to be sure it works as expected before putting it into your document.
您应该在单独的文件中开发这些代码,这样,就可以在将它们放入文档之前对其进行测试,以确保它们能像您期望的那样工作。
It then USES the handler for call-backs into your code as it processes the input document.
然后,在对输入文档进行处理的时候,它使用代码中的处理程序作为回调。
Bad: if you do not document your schemas, users have two other options — they can rifle through your source code or refer to a separate document.
不好的方法:如果您不给模式编写文档,用户就面临两种选择——他们可能去搜索您的源代码,或是去寻找单独的文档文件。
The main drawback to the generated object model approach is that it ties your code directly to the structure of the XML document.
所生成的对象模型方法的主要缺点是它使您的代码与XML文档结构直接相关。
If the document structure changes, you need to rerun the code generation and modify your application code to work with the resulting modified data classes.
如果文档结构发生变化,再需要重新生成代码,并修改应用程序代码以使用最终修改后的数据类。
Second, it allows you to change a document, even remove it, without having your code fail when you proceed to the next document.
其次,它允许您更改文档,甚至删除文档,而您处理下一文档时代码不会失败。
You need to know how the Document Object Model (DOM) works only if you wish to change the code in this tutorial to suit your own applications.
只有当希望修改本教程中的代码以适应具体应用程序时才需要了解文档对象模型(DOM)的工作原理。
For example, you can type your code any way you want, without worrying about the formatting, and it will still be formatted perfectly automatically each time you save your document.
例如,您可以采用任意方法输入代码,而无需担心格式问题,并且在每次保存文档时,系统仍将自动地设定代码的格式。
What if your database has some validation code that requires various fields to be filled before the document can be saved, and will produce all sorts of errors if you try to save before that?
如果数据库具有验证代码,这些代码要求在保存文档之前,各个字段都必须填写完整,并且如果还未填写完整就试图保存文档会产生各种错误,该怎么办?
Your JSON document doesn't contain any markup, just the URLs and metadata for the images your JavaScript code turns into a slide show.
我们的JSON文档不包含任何标记,只包含要转换为幻灯片的图像的URL和元数据。
If you want to use your own XML documents, feel free; you just need to adjust the sample code to match the structure and logical names in your own document.
如果希望使用自己的XML文档也完全可以,只要调整示例代码和文档的结构与逻辑名匹配即可。
To index and then search files, you first need write code that converts your files into Document objects.
为了建立索引并搜索文件,首先你要写代码把你的文件转换成Document对象。
For example, get Eclipse (see Resources), open a new project, copy and paste the code from Listing 1 into a new document, edit, and you are well on your way to a structured resume data file.
例如,获取Eclipse(参见参考资料),打开一个新项目,将清单1中的代码复制并粘贴到一个新文档中,编辑,您将很快创建一个结构化简历数据文件。
In the above code, you declare that your document will have a root element called RSS and that this element will have a child element called channel.
在以上代码中,您声明文档将有一个rss根元素,并且它有一个channel子元素。
You can adjust any of these Settings in your PHP code, too, so don't worry if you're not sure (for example, if you set portrait-mode document layouts here, you can still create landscape documents).
您可以在您的PHP代码中调整这些设置中的任意一个,如果无法确定也无需担心(例如,如果您在此处设置的是像模式文档布局,您仍然可以创建景观文档)。
They let you do things like format your code and organize imports automatically when you save your document. To configure save actions.
在保存文档时,保存操作将允许自动执行格式化代码及组织导入之类的操作。
The problem with this approach is that it requires your handler code to always know where the parser is in the document, and to interpret the components appropriately.
这个方法存在的问题是,它需要处理程序代码始终知道解析器位于文档的哪个位置,并需要它正确地解释组件。
By so closely reflecting the document structure, it creates a tight coupling between your application code and that structure.
通过如此贴实地反映文档结构,该方法使应用程序代码和文档结构之间紧密耦合。
Your code often needs to walk through things item by item, whether it's a list, a file, or an XML document.
代码通常需要逐项遍历内容,不管它是列表、文件,还是XML文档。
To try this, you can put the form on a Web site, then save the code in Listing 14 as an HTML document on your desktop.
要尝试此操作,您可以把该表单放到Web站点中,然后把清单14中的代码另存为桌面上的HTML文档。
If you're working with a stable document structure defined by a Schema or DTD, and the structure suits your application's needs, code generation is probably the best approach.
如果使用由Schema或DTD定义的稳定文档结构,并且该结构适合应用程序的需要,则代码生成方法可能是最佳方法。
If the core of your application is processing an XML document, the XML Code framework constructed by JBind may make it very easy to use.
如果应用程序的核心是处理XML文档,则使用由JBind构造的“XML代码”框架可能非常简单。
So while you work directly with SAXParserFactory in your code, JAXP might use Apache Xerces behind the scenes to handle the actual parsing of a document.
因此虽然在代码中直接使用SAXParserFactory,JAXP必须在幕后使用ApacheXerces来处理真正的文档解析。
Then, you can use the XML to SQL wizard to unit test the XML document for validity before writing your code that will use the XMLToSQL run time library.
同时,您也可以在编写使用XMLToSQL运行时库的代码之前通过XMLToSQL向导进行XML文档的单元测试。
Starting the project from within Visual Studio.net loads Excel or Word along with your Office document, and runs your code as necessary.
从Visual Studio . NET内启动项目,加载Excel或Word以及Office文档,并在必要时运行代码。
Make your code legible, use Perl's built-in functions instead of writing your own, and document obscure ways of doing obvious things.
为了保证代码的正确性,最好尽量使用那些Perl内置的函数,而较少使用自己所编写的函数,并且注意证明并记录这些不那么显然的方法。
Those search engines can also more clearly find common words throughout your document without having to filter through code.
查找引擎不需求过滤代码就能够找到将全部文档的通用关键字。
The last line of code transforms the XML document using the XSL document, and sends the result as XHTML to your browser.
最后一行代码通过使用XSL文件来转换XML文件,并将其以XHTML的形式把结果发到浏览器上。
应用推荐