Click here to Skip to main content
15,885,537 members
Articles / Web Development / ASP.NET

Multiple Language Syntax Highlighting, Part 1: JScript

Rate me:
Please Sign up or sign in to vote.
4.96/5 (58 votes)
12 Mar 200312 min read 284K   6.1K   170  
Makes automaticaly highlighting source code in web page a reality (for C,C++,JScript, VBScript, XML)
<?xml version="1.0" ?>
<xs:schema id="NewDataSet" targetNamespace="http://tempuri.org/highlight.xsd" xmlns:mstns="http://tempuri.org/highlight.xsd" xmlns="http://tempuri.org/highlight.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified">
	<xs:element name="highlight">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="keywordlists" minOccurs="0" maxOccurs="unbounded">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="keywordlist" minOccurs="0" maxOccurs="unbounded">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="kw" nillable="true" minOccurs="0" maxOccurs="unbounded">
											<xs:complexType>
												<xs:simpleContent msdata:ColumnName="kw_Text" msdata:Ordinal="0">
													<xs:extension base="xs:string"></xs:extension>
												</xs:simpleContent>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
									<xs:attribute name="id" form="unqualified" type="xs:string" />
									<xs:attribute name="pre" form="unqualified" type="xs:string" />
									<xs:attribute name="post" type="xs:string" />
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="languages" minOccurs="0" maxOccurs="unbounded">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="language" minOccurs="0" maxOccurs="unbounded">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="contexts" minOccurs="0" maxOccurs="unbounded">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="context" minOccurs="0" maxOccurs="unbounded">
														<xs:complexType>
															<xs:sequence>
																<xs:element name="detect2chars" minOccurs="0" maxOccurs="unbounded">
																	<xs:complexType>
																		<xs:attribute name="attribute" form="unqualified" type="xs:string" />
																		<xs:attribute name="context" form="unqualified" type="xs:string" />
																		<xs:attribute name="char" form="unqualified" type="xs:string" />
																		<xs:attribute name="char1" form="unqualified" type="xs:string" />
																	</xs:complexType>
																</xs:element>
																<xs:element name="regexp" minOccurs="0" maxOccurs="unbounded">
																	<xs:complexType>
																		<xs:attribute name="attribute" form="unqualified" type="xs:string" />
																		<xs:attribute name="context" form="unqualified" type="xs:string" />
																		<xs:attribute name="expression" form="unqualified" type="xs:string" />
																	</xs:complexType>
																</xs:element>
																<xs:element name="keyword" minOccurs="0" maxOccurs="unbounded">
																	<xs:complexType>
																		<xs:attribute name="attribute" form="unqualified" type="xs:string" />
																		<xs:attribute name="context" form="unqualified" type="xs:string" />
																		<xs:attribute name="family" form="unqualified" type="xs:string" />
																	</xs:complexType>
																</xs:element>
																<xs:element name="linecontinue" minOccurs="0" maxOccurs="unbounded">
																	<xs:complexType>
																		<xs:attribute name="attribute" form="unqualified" type="xs:string" />
																		<xs:attribute name="context" form="unqualified" type="xs:string" />
																	</xs:complexType>
																</xs:element>
															</xs:sequence>
															<xs:attribute name="id" form="unqualified" type="xs:string" />
															<xs:attribute name="attribute" form="unqualified" type="xs:string" />
														</xs:complexType>
													</xs:element>
												</xs:sequence>
												<xs:attribute name="default" form="unqualified" type="xs:string" />
											</xs:complexType>
										</xs:element>
									</xs:sequence>
									<xs:attribute name="id" form="unqualified" type="xs:string" />
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
			<xs:attribute name="needs-build" form="unqualified" type="xs:string" />
			<xs:attribute name="save-build" form="unqualified" type="xs:string" />
		</xs:complexType>
	</xs:element>
</xs:schema>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Engineer
United States United States
Jonathan de Halleux is Civil Engineer in Applied Mathematics. He finished his PhD in 2004 in the rainy country of Belgium. After 2 years in the Common Language Runtime (i.e. .net), he is now working at Microsoft Research on Pex (http://research.microsoft.com/pex).

Comments and Discussions