zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #02575
[Merge] lp:~zorba-coders/zorba/bug_data_converters_json_900462 into lp:zorba
Sorin Marian Nasoi has proposed merging lp:~zorba-coders/zorba/bug_data_converters_json_900462 into lp:zorba.
Requested reviews:
Sorin Marian Nasoi (sorin.marian.nasoi)
Matthias Brantner (matthias-brantner)
Related bugs:
Bug #900462 in Zorba: "json:serialize returns invalid json"
https://bugs.launchpad.net/zorba/+bug/900462
For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug_data_converters_json_900462/+merge/84578
Fixed bug #900462 (json:serialize returns invalid json)
--
The attached diff has been truncated due to its size.
https://code.launchpad.net/~zorba-coders/zorba/bug_data_converters_json_900462/+merge/84578
Your team Zorba Coders is subscribed to branch lp:zorba.
=== added file 'CMakeLists.txt'
--- CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ CMakeLists.txt 2011-12-06 07:32:41 +0000
@@ -0,0 +1,39 @@
+# Copyright 2006-2010 The FLWOR 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.
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+PROJECT (zorba_data-converters_module)
+ENABLE_TESTING ()
+INCLUDE (CTest)
+
+IF (WIN32)
+ # On Windows we use proxy modules that try to guess first the location
+ # of the required third party libraries. This will search in order in:
+ # 1. the path pointed by ZORBA_THIRD_PARTY_REQUIREMENTS
+ # 2. the Program Files directory available on the users computer
+ # 3. the PATH environment variable
+ # The logic is implemented by the macros in the ProxyFindModule.cmake module.
+ LIST (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules/Windows")
+ENDIF (WIN32)
+LIST (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
+
+FIND_PACKAGE (Zorba REQUIRED HINTS "${ZORBA_BUILD_DIR}")
+MESSAGE(STATUS "Zorba_USE_FILE ${Zorba_USE_FILE}")
+INCLUDE ("${Zorba_USE_FILE}")
+
+
+ADD_SUBDIRECTORY("src")
+
+DONE_DECLARING_ZORBA_URIS()
=== renamed file 'CMakeLists.txt' => 'CMakeLists.txt.moved'
=== added directory 'cmake_modules'
=== renamed directory 'cmake_modules' => 'cmake_modules.moved'
=== added file 'cmake_modules/FindJansson.cmake'
--- cmake_modules/FindJansson.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/FindJansson.cmake 2011-12-06 07:32:41 +0000
@@ -0,0 +1,64 @@
+# Copyright 2006-2008 The FLWOR 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.
+#
+# - Find Jansson
+#
+# Once done this will define
+#
+# Jansson_FOUND - System has Jansson
+# Jansson_INCLUDE_DIRS - The Jansson include directories
+# Jansson_LIBRARIES - The libraries needed to use Jansson
+
+IF (Jansson_INCLUDE AND Jansson_LIBRARY)
+ # in cache already
+ SET(Jansson_FIND_QUIETLY TRUE)
+ENDIF (Jansson_INCLUDE AND Jansson_LIBRARY)
+
+SET(LIBRARY_NAMES jansson jansson.lib Release/jansson.lib bin/jansson.lib bin/Release/jansson.lib)
+FIND_LIBRARY(
+ Jansson_LIBRARY
+ NAMES ${LIBRARY_NAMES}
+ PATHS /usr/lib /usr/local/lib /opt/local/lib ${Jansson_LIBRARIES})
+
+FIND_PATH(
+ Jansson_INCLUDE
+ NAMES jansson.h
+ PATH_SUFFIXES jansson src
+ PATHS ${Jansson_INCLUDE_DIRS})
+
+IF(Jansson_LIBRARY AND Jansson_INCLUDE)
+ SET(Jansson_FOUND TRUE)
+ SET(Jansson_LIBRARIES ${Jansson_LIBRARY})
+ SET(Jansson_INCLUDE_DIRS ${Jansson_INCLUDE})
+ELSE(Jansson_LIBRARY AND Jansson_INCLUDE)
+ IF(NOT Jansson_LIBRARY)
+ MESSAGE(STATUS "Jansson static library could not be found matching one of: ${LIBRARY_NAMES}")
+ ENDIF(NOT Jansson_LIBRARY)
+ IF(NOT Jansson_INCLUDE)
+ MESSAGE(STATUS "Jansson source directory could not be found.")
+ ENDIF(NOT Jansson_INCLUDE)
+
+ SET(Jansson_FOUND FALSE)
+ SET(Jansson_LIBRARIES)
+ SET(Jansson_INCLUDE)
+ENDIF (Jansson_LIBRARY AND Jansson_INCLUDE)
+
+IF(Jansson_FOUND)
+ IF(NOT Jansson_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Jansson : ${Jansson_LIBRARY}")
+ MESSAGE(STATUS "Found Jansson include path : ${Jansson_INCLUDE_DIRS}")
+ ENDIF(NOT Jansson_FIND_QUIETLY)
+ELSE(Jansson_FOUND)
+ MESSAGE(STATUS "Could not find Jansson library.")
+ENDIF(Jansson_FOUND)
=== added file 'cmake_modules/FindLibTidy.cmake'
--- cmake_modules/FindLibTidy.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/FindLibTidy.cmake 2011-12-06 07:32:41 +0000
@@ -0,0 +1,60 @@
+# Copyright 2006-2008 The FLWOR 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.
+
+# - Try to find the HTML Tidy lib
+#
+# LIBTIDY_FOUND - true if LIBTIDY was found
+# LIBTIDY_INCLUDE_DIRS - Directory to include to get LIBTIDY headers
+# Note: always include LIBTIDY headers as e.g.,
+# tidy/tidy.h
+# LIBTIDY_LIBRARIES - Libraries to link against for the LIBTIDY
+#
+
+
+IF (LIBTIDY_INCLUDE_DIR)
+ SET(LibTidy_FIND_QUIETLY TRUE)
+ENDIF (LIBTIDY_INCLUDE_DIR)
+
+# Look for the header file.
+FIND_PATH(LIBTIDY_INCLUDE_DIR tidy.h PATH_SUFFIXES tidy)
+MARK_AS_ADVANCED(LIBTIDY_INCLUDE_DIR)
+
+# Look for the library.
+# FIND_LIBRARY(LIBTIDY_LIBRARY NAMES tidy PATHS ${LIBTIDY_LIBRARIES})
+FIND_LIBRARY(LIBTIDY_LIBRARY NAMES tidy)
+MARK_AS_ADVANCED(LIBTIDY_LIBRARY)
+
+# INCLUDE(FindPackageHandleStandardArgs)
+# only available in cmake > 2.6
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBTIDY DEFAULT_MSG LIBTIDY_INCLUDE_DIR LIBTIDY_LIBRARY)
+#IF (LIBTIDY_FOUND)
+# SET(LIBTIDY_LIBRARIES ${LIBTIDY_LIBRARY})
+# SET(LIBTIDY_INCLUDE_DIRS ${LIBTIDY_INCLUDE_DIR})
+#ELSE (LIBTIDY_FOUND)
+# SET(LIBTIDY_LIBRARIES)
+# SET(LIBTIDY_INCLUDE_DIRS)
+#ENDIF (LIBTIDY_FOUND)
+IF (LIBTIDY_INCLUDE_DIR AND LIBTIDY_LIBRARY)
+ SET(LIBTIDY_FOUND 1)
+ SET(LIBTIDY_LIBRARIES ${LIBTIDY_LIBRARY})
+ SET(LIBTIDY_INCLUDE_DIRS ${LIBTIDY_INCLUDE_DIR})
+ IF(NOT LibTidy_FIND_QUIETLY)
+ MESSAGE(STATUS "Found libtidy library : " ${LIBTIDY_LIBRARY})
+ MESSAGE(STATUS "Found libtidy include path : " ${LIBTIDY_INCLUDE_DIR})
+ ENDIF(NOT LibTidy_FIND_QUIETLY)
+ELSE (LIBTIDY_INCLUDE_DIR AND LIBTIDY_LIBRARY)
+ SET(LIBTIDY_FOUND 0)
+ SET(LIBTIDY_LIBRARIES)
+ SET(LIBTIDY_INCLUDE_DIRS)
+ENDIF (LIBTIDY_INCLUDE_DIR AND LIBTIDY_LIBRARY)
=== added directory 'cmake_modules/Windows'
=== added file 'cmake_modules/Windows/FindJansson.cmake'
--- cmake_modules/Windows/FindJansson.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/Windows/FindJansson.cmake 2011-12-06 07:32:41 +0000
@@ -0,0 +1,30 @@
+# Copyright 2010 The FLWOR 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.
+
+# - Try to find the Jansson lib on Windows
+#
+# This is a proxy module that calls the FindJansson.cmake module. Before
+# doing that, we try to guess where Jansson might be on the user's machine.
+# The user should provide ZORBA_THIRD_PARTY_REQUIREMENTS which is a path where
+# the Jansson directory can be found. The Jansson directory must have "jansson"
+# (case insensitive) in its name.
+#
+# This module helps the Windows user to avoid providing the following two
+# variables when building Zorba:
+# -D Jansson_INCLUDE="path_to_3rd_party_dir\*jansson*\src"
+# -D Jansson_LIBRARY="path_to_3rd_party_dir\*jansson*\bin\[Release\]jansson.lib"
+#
+# See the FindLibTidy.cmake module shipped with Zorba for more information.
+
+FIND_PACKAGE_WIN32(NAME Jansson FOUND_VAR Jansson_FOUND SEARCH_NAMES jansson)
=== added file 'cmake_modules/Windows/FindLibTidy.cmake'
--- cmake_modules/Windows/FindLibTidy.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/Windows/FindLibTidy.cmake 2011-12-06 07:32:41 +0000
@@ -0,0 +1,37 @@
+# Copyright 2010 The FLWOR 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.
+
+# - Try to find the HTML Tidy lib on Windows
+#
+# This is a proxy module that calls the FindLibTidy.cmake module. Before
+# doing that, we try to guess where LibTidy might be on the user's machine.
+# The user should provide ZORBA_THIRD_PARTY_REQUIREMENTS which is a path where
+# the LibTidy directory can be found. The LibTidy directory must have "tidy"
+# (case insensitive) in its name.
+#
+# This module helps the Windows user to avoid providing the following two
+# variables when building Zorba:
+# -D LIBTIDY_INCLUDE_DIR="path_to_3rd_party_dir\*tidy*\include"
+# -D LIBTIDY_LIBRARY="path_to_3rd_party_dir\*tidy*\lib\tidy.lib"
+#
+# See the FindLibTidy.cmake module shipped with Zorba for more information.
+
+FIND_PACKAGE_WIN32(NAME LibTidy FOUND_VAR LIBTIDY_FOUND SEARCH_NAMES tidy)
+
+IF (LIBTIDY_FOUND)
+
+ # find the needed DLL's
+ FIND_PACKAGE_DLLS_WIN32 (${FOUND_LOCATION} tidy.dll)
+
+ENDIF (LIBTIDY_FOUND)
=== added directory 'src'
=== renamed directory 'src' => 'src.moved'
=== added file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/CMakeLists.txt 2011-12-06 07:32:41 +0000
@@ -0,0 +1,19 @@
+# Copyright 2006-2008 The FLWOR 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.
+
+# all external module libraries are generated in the directory
+# of the corresponding .xq file
+MESSAGE(STATUS "Add com")
+ADD_SUBDIRECTORY(com)
+MESSAGE(STATUS "End modules")
=== added directory 'src/com'
=== added file 'src/com/CMakeLists.txt'
--- src/com/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/com/CMakeLists.txt 2011-12-06 07:32:41 +0000
@@ -0,0 +1,14 @@
+# Copyright 2006-2008 The FLWOR 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.
+ADD_SUBDIRECTORY(zorba-xquery)
=== added directory 'src/com/zorba-xquery'
=== added file 'src/com/zorba-xquery/CMakeLists.txt'
--- src/com/zorba-xquery/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/CMakeLists.txt 2011-12-06 07:32:41 +0000
@@ -0,0 +1,14 @@
+# Copyright 2006-2008 The FLWOR 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.
+ADD_SUBDIRECTORY(www)
=== added directory 'src/com/zorba-xquery/www'
=== added file 'src/com/zorba-xquery/www/CMakeLists.txt'
--- src/com/zorba-xquery/www/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/CMakeLists.txt 2011-12-06 07:32:41 +0000
@@ -0,0 +1,14 @@
+# Copyright 2006-2008 The FLWOR 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.
+ADD_SUBDIRECTORY(modules)
=== added directory 'src/com/zorba-xquery/www/modules'
=== added file 'src/com/zorba-xquery/www/modules/CMakeLists.txt'
--- src/com/zorba-xquery/www/modules/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/CMakeLists.txt 2011-12-06 07:32:41 +0000
@@ -0,0 +1,14 @@
+# Copyright 2006-2008 The FLWOR 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.
+ADD_SUBDIRECTORY(converters)
=== added directory 'src/com/zorba-xquery/www/modules/converters'
=== added file 'src/com/zorba-xquery/www/modules/converters/CMakeLists.txt'
--- src/com/zorba-xquery/www/modules/converters/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/CMakeLists.txt 2011-12-06 07:32:41 +0000
@@ -0,0 +1,100 @@
+# Copyright 2006-2008 The FLWOR 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.
+
+#
+# LibTidy
+#
+IF (ZORBA_SUPPRESS_LIBTIDY)
+ MESSAGE (STATUS "ZORBA_SUPPRESS_LIBTIDY is true - not searching for LibTidy.")
+ELSE (ZORBA_SUPPRESS_LIBTIDY)
+
+ MESSAGE (STATUS "Looking for LibTidy")
+ FIND_PACKAGE (LibTidy)
+
+ IF (LIBTIDY_FOUND)
+ MESSAGE (STATUS "Found LibTidy library -- " ${LIBTIDY_LIBRARIES})
+ SET (HTML_LINK_LIBRARIES ${LIBTIDY_LIBRARIES})
+
+ INCLUDE_DIRECTORIES (${LIBTIDY_INCLUDE_DIR})
+ INCLUDE_DIRECTORIES ("html.xq.src")
+ DECLARE_ZORBA_SCHEMA (FILE "html-options.xsd"
+ URI "http://www.zorba-xquery.com/modules/converters/html-options")
+ DECLARE_ZORBA_MODULE (URI "http://www.zorba-xquery.com/modules/converters/html" VERSION 1.0 FILE "html.xq" LINK_LIBRARIES "${LIBTIDY_LIBRARIES}")
+ ADD_TEST_DIRECTORY ("${PROJECT_SOURCE_DIR}/test_html")
+
+ ADD_TEST(link_crawler_test_for_compilation "${ZORBA_EXE}" -f -q "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../test_html/Queries/converters/html/link_crawler2.xq2" --compile-only)
+ ELSE (LIBTIDY_FOUND)
+ MESSAGE (STATUS "LibTidy library not found -- if you want to use HTML Tidy functionality please set LIBTIDY_INCLUDE_DIR and LIBTIDY_LIBRARIES cmake parameters.")
+ ENDIF (LIBTIDY_FOUND)
+ENDIF (ZORBA_SUPPRESS_LIBTIDY)
+MESSAGE (STATUS "")
+
+
+#
+# Jansson
+#
+IF (ZORBA_SUPPRESS_JANSSON)
+ MESSAGE (STATUS "ZORBA_SUPPRESS_JANSSON is true - not searching for Jansson.")
+ELSE (ZORBA_SUPPRESS_JANSSON)
+
+ MESSAGE (STATUS "Looking for Jansson")
+ FIND_PACKAGE (Jansson)
+
+ IF (Jansson_FOUND)
+ MESSAGE (STATUS "Found Jansson library -- " ${Jansson_LIBRARIES})
+
+ SET (JSON_LINK_LIBRARIES ${Jansson_LIBRARIES})
+ INCLUDE_DIRECTORIES (${Jansson_INCLUDE_DIRS})
+ INCLUDE_DIRECTORIES ("json.xq.src")
+ DECLARE_ZORBA_SCHEMA (FILE "json-options.xsd"
+ URI "http://www.zorba-xquery.com/modules/converters/json-options")
+ DECLARE_ZORBA_MODULE (URI "http://www.zorba-xquery.com/modules/converters/json" VERSION 1.0 FILE "json.xq" LINK_LIBRARIES "${Jansson_LIBRARIES}")
+ ADD_TEST_DIRECTORY ("${PROJECT_SOURCE_DIR}/test_json")
+
+ IF(ZORBA_NO_UNICODE)
+ SET_TESTS_PROPERTIES(zorba_data-converters_module/converters/jansson/parse_json_03.xq
+ PROPERTIES WILL_FAIL TRUE)
+ ENDIF(ZORBA_NO_UNICODE)
+
+ ELSE (Jansson_FOUND)
+ MESSAGE (STATUS "Jansson library not found -- if you want to use Json functionality please set Jansson_INCLUDE_DIRS and Jansson_LIBRARIES cmake parameters.")
+ ENDIF (Jansson_FOUND)
+ENDIF (ZORBA_SUPPRESS_JANSSON)
+MESSAGE (STATUS "")
+
+
+# csv
+DECLARE_ZORBA_SCHEMA (FILE csv-options.xsd
+ URI "http://www.zorba-xquery.com/modules/converters/csv-options")
+DECLARE_ZORBA_MODULE (URI "http://www.zorba-xquery.com/modules/converters/csv" VERSION 1.0 FILE "csv.xq")
+
+# add unit test for streambuf implementation in csv, related to streamable strings
+CREATE_TEST_SOURCELIST (
+ StreambufUnitTests
+ StreambufUnitTests.cpp
+ streambuftest.cpp
+)
+ADD_EXECUTABLE (StreambufUnitTests ${StreambufUnitTests} csv.xq.src/stringiterator_streambuf.cpp)
+SET_TARGET_PROPERTIES (StreambufUnitTests PROPERTIES
+ FOLDER "Tests"
+)
+
+ADD_TEST ("streamable_string_streambuf" StreambufUnitTests "streambuftest")
+ADD_TEST_DIRECTORY("${PROJECT_SOURCE_DIR}/test")
+
+IF(ZORBA_NO_UNICODE)
+ SET_TESTS_PROPERTIES(zorba_data-converters_module/converters/csv/csv_parse_utf8_11.xq
+ PROPERTIES WILL_FAIL TRUE)
+ENDIF(ZORBA_NO_UNICODE)
+
=== added file 'src/com/zorba-xquery/www/modules/converters/csv-options.xsd'
--- src/com/zorba-xquery/www/modules/converters/csv-options.xsd 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/csv-options.xsd 2011-12-06 07:32:41 +0000
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="utf-8"?>
+<schema
+ targetNamespace="http://www.zorba-xquery.com/modules/converters/csv-options"
+ xmlns:csv="http://www.zorba-xquery.com/modules/converters/csv-options"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ version="1.0.0">
+<!--
+:: Copyright 2006-2008 The FLWOR 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.
+::
+-->
+
+
+ <complexType name="csvType">
+ <attribute name="separator" type="string" default=","/>
+ <attribute name="quote-char" type="string" default="""/>
+ <attribute name="quote-escape" type="string" default=""""/>
+ </complexType>
+ <complexType name="first-row-is-headerType">
+ <attribute name="line">
+ <simpleType>
+ <restriction base="string">
+ <pattern value="\p{Zs}*[0-9]*\p{Zs}*(-\p{Zs}*[0-9]*)?\p{Zs}*"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="ignore-foreign-input" default="false">
+ <simpleType>
+ <restriction base="string">
+ <pattern value="true|false"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="accept-all-lines" default="false">
+ <simpleType>
+ <restriction base="string">
+ <pattern value="true|false"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ <complexType name="start-from-rowType">
+ <attribute name="line">
+ <simpleType>
+ <restriction base="string">
+ <pattern value="\p{Zs}*[0-9]*\p{Zs}*(-\p{Zs}*[0-9]*)?\p{Zs}*"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ <simpleType name="alignType">
+ <restriction base="string">
+ <enumeration value="left"/>
+ <enumeration value="right"/>
+ </restriction>
+ </simpleType>
+ <attributeGroup name="alignGroup">
+ <attribute name="align" type="csv:alignType"/>
+ </attributeGroup>
+ <complexType name="column-widthsType">
+ <sequence>
+ <element name="column-width" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <simpleContent>
+ <extension base="positiveInteger">
+ <attributeGroup ref="csv:alignGroup"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ </element>
+ </sequence>
+ <attributeGroup ref="csv:alignGroup"/>
+ </complexType>
+ <complexType name="column-positionsType">
+ <sequence>
+ <element name="column-position" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <simpleContent>
+ <extension base="positiveInteger">
+ <attributeGroup ref="csv:alignGroup"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ </element>
+ </sequence>
+ <attributeGroup ref="csv:alignGroup"/>
+ </complexType>
+ <complexType name="row-nameType">
+ <sequence>
+ <any minOccurs="0"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="optionsType">
+ <all>
+ <element name="csv" type="csv:csvType" minOccurs="0"/>
+ <element name="column-widths" type="csv:column-widthsType" minOccurs="0"/>
+ <element name="column-positions" type="csv:column-positionsType" minOccurs="0"/>
+ <element name="first-row-is-header" type="csv:first-row-is-headerType" minOccurs="0"/>
+ <element name="start-from-row" type="csv:start-from-rowType" minOccurs="0"/>
+ <element name="add-last-void-columns" minOccurs="0"/>
+ <element name="xml-nodes" minOccurs="0">
+ <complexType>
+ <sequence>
+ <any processContents="skip"/>
+ </sequence>
+ </complexType>
+ </element>
+ </all>
+ </complexType>
+
+ <element name="options" type="csv:optionsType"/>
+
+</schema>
\ No newline at end of file
=== added file 'src/com/zorba-xquery/www/modules/converters/csv.xq'
--- src/com/zorba-xquery/www/modules/converters/csv.xq 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/csv.xq 2011-12-06 07:32:41 +0000
@@ -0,0 +1,369 @@
+xquery version "3.0";
+
+(:
+ : Copyright 2006-2009 The FLWOR 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.
+:)
+
+(:~
+ : Function library providing converters from CSV/TXT to XML and back.
+ : The functions are optimized to work with large amounts of data, in a streaming way.
+ :
+ : @author Daniel Turcanu
+ : @project data processing/data converters
+ :)
+module namespace csv = "http://www.zorba-xquery.com/modules/converters/csv";
+
+(:~
+ : Import module for checking if csv options element is validated.
+ :)
+import module namespace schemaOptions = "http://www.zorba-xquery.com/modules/schema";
+
+(:~
+ : Contains the definitions of the csv options element.
+ :)
+import schema namespace csv-options = "http://www.zorba-xquery.com/modules/converters/csv-options";
+
+declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
+declare option ver:module-version "1.0";
+
+(:~
+ : Parse a CSV or fixed size text and convert to XML.<br/>
+ : By default each line is converted to a <row> element, and each field to a <column> element inside <row>.<br/>
+ : The format of the param $options is:<br/>
+ : <csv-options:options><br/>
+ : <csv [separator="default comma ,"] ? <br/>
+ : [quote-char="default double quotes &quote;"]? <br/>
+ : [quote-escape="default double double quotes &quote;&quote;"]? /> <br/>
+ : <br/>
+ : or<br/>
+ : <column-widths><br/>
+ : <column-width><i>[column fixed width, unsigned int]</i><column-width>*<br/>
+ : </column-widths><br/>
+ : <br/>
+ : or<br/>
+ : <column-positions><br/>
+ : <column-position><i>[column position on line, unsigned int]</i><column-position>*<br/>
+ : </column-positions><br/>
+ : <br/>
+ : <first-row-is-header [line="<i>first_line[-last_line]?</i>"]?/>?<br/>
+ : <start-from-row line="<i>first_line[-last_line]?</i>"/>?<br/>
+ : <add-last-void-columns/>?<br/>
+ : <xml-nodes><br/>
+ : [<<i>row-name</i>><br/>
+ : [<<i>column-name/</i>>]?<br/>
+ : </<i>row-name</i>>]?<br/>
+ : </xml-nodes>?<br/>
+ : </csv-options:options><br/>
+ : <br/>
+ : All the parameters are optional and can appear in any order.<br/>
+ : All the parameters are case sensitive. The namespace used is "http://www.zorba-xquery.com/modules/converters/csv-options".<br/>
+ : All strings must have UTF-8 encoding.<br/>
+ : Parameters csv, column-widths, column-positions are mutually exclusive. If none is specified,
+ : the input string is assumed to be csv.<br/>
+ : Description of parameters:
+ : <dl>
+ : <dt><b>csv</b></dt>
+ : <dd> Specifies the parameters for parsing a csv string.<br/>
+ : <dl>
+ : <dt><b>separator</b></dt>
+ : <dd>The character or group of characters used to separating fields in a row.
+ : If it is not specified, it defaults to comma ','.
+ : </dd>
+ : <dt><b>quote-char</b></dt>
+ : <dd>The character or group of characters used for quoting the fields that may contain special characters,
+ : like separator, new line or this quote char. The default value is double quote ".<br/>
+ : </dd>
+ : <dt><b>quote-escape</b></dt>
+ : <dd>The group of characters used for escaping the quote char inside a field. The whole quote escape group
+ : is translated to a quote char during parsing. The default value is double double quotes "".<br/>
+ : </dd>
+ : </dl>
+ : </dd>
+ : <br/>
+ : <dt><b>column-widths</b></dt>
+ : <dd>Specifies the column widths for fixed size text. It contains multiple column-width child elements
+ : specifying the fixed width of each column, from left to right.<br/>
+ : If the line has more fields than specified, they are ignored.
+ : </dd>
+ : <dt><b>column-positions</b></dt>
+ : <dd>This is an alternative to column-widths, and specifies instead the starting position of each column.
+ : Column positions are 1 based, and are specified in order from left to right.
+ : The last column is read until end of line. The first column position can be greater than 1, if you want
+ : to parse only a part of the input text.
+ : </dd>
+ : <dt><b>first-row-is-header</b></dt>
+ : <dd>The presence of this element indicates that the first row is to be treated as the name of the columns.
+ : If it is not present, then each field is enclosed in a <column> element,
+ : or how it is specified in <xml-nodes> parameter.<br/>
+ : If the first row is the header, then each field is enclosed in an element with the corresponding name from the header.<br/>
+ : For example, the csv:<br/>
+ : <i>ID,Name,Occupation<br/>
+ : 1,John,student</i><br/>
+ : <br/>
+ : is parsed into<br/>
+ : <i><row><br/>
+ : <ID>1</ID><br/>
+ : <Name>John</Name><br/>
+ : <Occupation>student</Occupation><br/>
+ : </row></i><br/>
+ : <br/>
+ : If the header names contain characters that cannot be used in a QName, they are replaced with underscore '_'.<br/>
+ : The namespace for the header QNames is taken from the column name specified in xml-nodes parameter, or from
+ : the row name, or if that doesn't exist either then empty namespace is used. <br/>
+ : If the header is not the first line in the input string, the starting line can be specified in the <b>line</b> attribute.<br/>
+ : If a column does not have a name, a new name is constructed in the form <i>columnN</i> where N is the position of the column,
+ : starting from 1.<br/>
+ : <b>Subheaders</b><br/>
+ : If the header consists of more than one line, this can be specified in the <b>line</b> attribute in the form
+ : "<i>first_line - last_line</i>". Having more lines as the header translates into a hierarchy of elements in the xml.<br/>
+ : For example, the csv:<br/>
+ : <i>ID,Name,,Occupation<br/>
+ : ,First Name,Last Name,<br/>
+ : 1,John,Howard,student</i><br/>
+ : <br/>
+ : is parsed into<br/>
+ : <i><row><br/>
+ : <ID>1</ID><br/>
+ : <Name><br/>
+ : <First_Name>John</First_Name><br/>
+ : <Last_Name>Howard</Last_Name><br/>
+ : </Name><br/>
+ : <Occupation>student</Occupation><br/>
+ : </row></i><br/>
+ : <br/>
+ : This element can have an attribute "accept-all-lines" with values "false" or "true" (default "false").
+ : When set to true it tells the parser to not report lines that do not have the same number of items as
+ : the header. If set to false, the parser will raise a csv:WrongInput error for these lines.<br/>
+ : </dd>
+ : <dt><b>start-from-row</b></dt>
+ : <dd>If the data does not start from line 1 or immediately after the header,
+ : you can specify the starting line in the <b>line</b> attribute.<br/>
+ : Also you can use this attribute in the form "<i>first_line - last_line</i>" to specify also the last line
+ : if you don't want the whole csv to be parsed.
+ : </dd>
+ : <dt><b>add-last-void-columns</b></dt>
+ : <dd>In the case when using headers and some data lines are shorter than the header, by default the excess columns are ignored
+ : for those lines. You can set the add-last-void-columns parameter to make all the columns appear in xml even if they are void.
+ : </dd>
+ : <dt><b>xml-nodes</b></dt>
+ : <dd>With this parameter you can specify the names for the row element and for the column element if there is no header.<br/>
+ : The first element child of this element specifies the desired QName of the row element in the output xml.
+ : The name of this element will be used as the name of the row element.<br/>
+ : The element child of this row element is the column element, and its name will be used as the name of the column elements
+ : that enclose the fields in the output xml if there is no header. <br/>
+ : If the csv has a header, only the namespace is used from the column element.<br/>
+ : For example, with parameter:<br/>
+ : <i><xml-nodes><br/>
+ : <r><br/>
+ : <c/><br/>
+ : </r><br/>
+ : </xml-nodes></i><br/>
+ : <br/>
+ : the output for each line will look like<br/>
+ : <i><r><br/>
+ : <c>field1</c><br/>
+ : <c>field2</c><br/>
+ : .......<br/>
+ : </r></i><br/>
+ : </dd>
+ : </dl>
+ : @param $csv the string containing the csv or fixed size text.
+ : @param $options this parameter is validated against "http://www.zorba-xquery.com/modules/converters/csv-options" schema.
+ : If this parameter is not specified, the row name is by default "row" and the column name is by default "column".
+ : @return a sequence of row elements, one for each line in csv
+ : @error csv:CSV001 if the input string is streamable string and cannot be rewinded
+ : @error csv:WrongInput if the input string has lines with variable number of items, and the csv has headers and
+ : the options do not specify the ignore-foreign-input attribute
+ : @error err:XQDY0027 if $options can not be validated against the csv-options schema
+ : @error err:XQDY0084 if the options parameter doesn't have the name "csv-options:options".
+ : @example test/Queries/converters/csv/csv_parse1.xq
+ : @example test/Queries/converters/csv/csv_parse2.xq
+ : @example test/Queries/converters/csv/csv_parse3.xq
+ : @example test/Queries/converters/csv/csv_parse6.xq
+ : @example test/Queries/converters/csv/csv_parse11.xq
+ : @example test/Queries/converters/csv/csv_parse_utf8_11.xq
+ : @example test/Queries/converters/csv/txt_parse5.xq
+ : @example test/Queries/converters/csv/txt_parse8.xq
+:)
+declare function csv:parse($csv as xs:string,
+ $options as element(csv-options:options)?) as element()*
+{
+ let $validated-options :=
+ if(empty($options)) then
+ $options
+ else
+ if(schemaOptions:is-validated($options)) then
+ $options
+ else
+ validate{$options}
+ return
+ csv:parse-internal($csv, $validated-options)
+};
+
+declare %private function csv:parse-internal($csv as xs:string,
+ $options as element(csv-options:options, csv-options:optionsType)?) as element()* external;
+
+(:~
+ : Convert XML into CSV or fixed size text.
+ :
+ : Note: if you want to serialize out the result, make sure that the serializer method is set to "text".
+ : For example, in zorba command line, you have to set the param --serialize-text.
+ : When using the <pre>file:write(...)</pre> function, you have to set the
+ : method serialization parameter to "text":
+ : <pre>
+ : <output:serialization-parameters<
+ : <output:method value="text"/<
+ : </output:serialization-parameters<
+ : </pre>
+ :
+ : The <pre>$options</pre> parameter must have the following format:
+ : <pre>
+ : <csv-options:options><br/>
+ : <csv [separator="default comma ,"] ? <br/>
+ : [quote-char="default double quotes &quote;"]? <br/>
+ : [quote-escape="default double double quotes &quote;&quote;"]? /> <br/>
+ : <br/>
+ : or<br/>
+ : <column-widths [align="left|right"]?><br/>
+ : <column-width [align="left|right"]?><i>[column fixed width, unsigned int]</i><column-width>*<br/>
+ : </column-widths><br/>
+ : <br/>
+ : or<br/>
+ : <column-positions [align="left|right"]?><br/>
+ : <column-position [align="left|right"]?><i>[column position on line, unsigned int]</i><column-position>*<br/>
+ : </column-positions><br/>
+ : <br/>
+ : <first-row-is-header/>?<br/>
+ : </csv-options:options>
+ : </pre>
+ :
+ : All the parameters are optional and can appear in any order.<br/>
+ : All the parameters are case sensitive. The namespace used is "http://www.zorba-xquery.com/modules/converters/csv-options".<br/>
+ : All strings must have UTF-8 encoding.<br/>
+ : Parameters csv, column-widths, column-positions are mutually exclusive.
+ : If none is specified, the xml is converted to csv.
+ :
+ : Description of parameters:
+ : <dl>
+ : <dt><b>csv</b></dt>
+ : <dd> Specifies the parameters for converting to csv.<br/>
+ : <dl>
+ : <dt><b>separator</b></dt>
+ : <dd>The character or group of characters used to separating fields in a row.
+ : If it is not specified, it defaults to comma ','.
+ : </dd>
+ : <dt><b>quote-char</b></dt>
+ : <dd>The character or group of characters used for quoting the fields that may contain special characters,
+ : like separator, new line or this quote char. The default value is double quote ".<br/>
+ : </dd>
+ : <dt><b>quote-escape</b></dt>
+ : <dd>The group of characters used for escaping the quote char inside a field. The whole quote escape group
+ : is translated to a quote char during parsing. The default value is double double quotes "".<br/>
+ : </dd>
+ : </dl>
+ : </dd>
+ : <br/>
+ : <dt><b>column-widths</b></dt>
+ : <dd>Specifies the column widths for fixed size text. It contains multiple column-width child elements
+ : specifying the fixed width of each column, from left to right.<br/>
+ : With the attribute <b>align</b> you can specify how to align fields that are smaller than the column width.
+ : The default alignment is left.<br/>
+ : </dd>
+ : <dt><b>column-positions</b></dt>
+ : <dd>This is an alternative to column-widths, and specifies instead the starting position of each column.
+ : Column positions are 1 based, and are specified in order from left to right.
+ : The last column has a variable length.<br/>
+ : With the attribute <b>align</b> you can specify how to align fields that are smaller than the column width.
+ : The default alignment is left. The last column does not need alignment.<br/>
+ : </dd>
+ : <dt><b>first-row-is-header</b></dt>
+ : <dd>The presence of this element indicates that the first row will contain the header, that is, the names of
+ : the column elements. Only the column names from the first row element are taken into account.<br/>
+ : For example, the row xml:<br/>
+ : <i><row><br/>
+ : <ID>1</ID><br/>
+ : <Name>John</Name><br/>
+ : <Occupation>student</Occupation><br/>
+ : </row></i><br/>
+ : <br/>
+ : is converted to<br/>
+ : <i>ID,Name,Occupation<br/>
+ : 1,John,student</i><br/>
+ : <br/>
+ : The header names are the localnames of the column elements, and the namespace is ignored.<br/>
+ : <b>Subheaders</b><br/>
+ : If the row-column hierarchy is more complex, then subheaders are also generated on subsequent lines.
+ : The number of subheaders depends on the depth of the column hierarchy.<br/>
+ : When generating the subheaders, the non-whitespace text nodes are also taken into account,
+ : and a separate column is generated for them too.<br/>
+ : For example, the xml row element:<br/>
+ : <i><row><br/>
+ : <ID>1</ID><br/>
+ : <Name><br/>
+ : Mr.<br/>
+ : <First_Name>John</First_Name><br/>
+ : <Last_Name>Howard</Last_Name><br/>
+ : </Name><br/>
+ : <Occupation>student</Occupation><br/>
+ : </row></i><br/>
+ : is converted to<br/>
+ : <i>ID,Name,,Occupation<br/>
+ : ,,First Name,Last Name,<br/>
+ : 1,Mr.,John,Howard,student</i><br/>
+ : <br/>
+ : If first-row-is-header is not specified and the columns have a deeper hierarchy,
+ : only the first layer of columns is processed, and the fields are the string values of each column.<br/>
+ : This element can have an attribute "ignore-foreign-input" with values "false" or "true" (default "false").
+ : When set to true it tells the serializer to ignore elements that to not match the header names.
+ : If set to false, the serializer will raise a csv:ForeignInput error for these elements.<br/>
+ : </dd>
+ : </dl>
+ :
+ : @param $xml a sequence of elements, each element representing a row. The name of each row element is ignored.
+ : The childs of each row are the column fields.
+ : @param $options The options parameter. See the function description for details.
+ : This parameter is validated against "http://www.zorba-xquery.com/modules/converters/csv-options" schema.
+ : @return the csv or fixed size text as string containing all the lines
+ : @error csv:CSV003 if the serialize output is streamable string and cannot be reset
+ : @error csv:ForeignInput if there are input elements in subsequent rows that do not match the headers,
+ : and the options specify first-row-is-header and do not specify the ignore-foreign-input attribute
+ : @error err:XQDY0027 if $options can not be validated against csv-options schema
+ : @error err:XQDY0084 if the options parameter doesn't have the name "csv-options:options".
+ : @example test/Queries/converters/csv/csv_serialize1.xq
+ : @example test/Queries/converters/csv/csv_serialize2.xq
+ : @example test/Queries/converters/csv/csv_serialize3.xq
+ : @example test/Queries/converters/csv/csv_serialize5.xq
+ : @example test/Queries/converters/csv/csv_serialize6.xq
+ : @example test/Queries/converters/csv/csv_parse_serialize6.xq
+ : @example test/Queries/converters/csv/txt_serialize6.xq
+ : @example test/Queries/converters/csv/txt_parse_serialize6.xq
+:)
+declare function csv:serialize($xml as element()*,
+ $options as element(csv-options:options)?) as xs:string
+{
+ let $validated-options :=
+ if(empty($options)) then
+ $options
+ else
+ if(schemaOptions:is-validated($options)) then
+ $options
+ else
+ validate{$options}
+ return
+ csv:serialize-internal($xml, $validated-options)
+};
+
+declare %private function csv:serialize-internal($xml as element()*,
+ $options as element(csv-options:options, csv-options:optionsType)?) as xs:string external;
=== added directory 'src/com/zorba-xquery/www/modules/converters/csv.xq.src'
=== added file 'src/com/zorba-xquery/www/modules/converters/csv.xq.src/castQName.cpp'
--- src/com/zorba-xquery/www/modules/converters/csv.xq.src/castQName.cpp 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/csv.xq.src/castQName.cpp 2011-12-06 07:32:41 +0000
@@ -0,0 +1,404 @@
+
+/*
+ * Copyright 2006-2008 The FLWOR 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.
+ */
+
+#include <zorba/zorba.h>
+#include <string>
+
+
+namespace zorba{
+
+class XQCharType
+{
+public:
+ static bool isLetter(uint32_t cp);
+ static bool isBaseChar(uint32_t cp);
+ static bool isIdeographic(uint32_t cp);
+ static bool isDigit(uint32_t cp);
+ static bool isCombiningChar(uint32_t cp);
+ static bool isExtender(uint32_t cp);
+ static bool isNameChar(uint32_t cp);
+};
+
+typedef struct
+{
+ unsigned short left, right;
+} CodePointRange_t;
+
+
+static const CodePointRange_t base_char_range[] =
+{
+ {0x0041,0x005A}, {0x0061,0x007A}, {0x00C0,0x00D6}, {0x00D8,0x00F6}, {0x00F8,0x00FF}, {0x0100,0x0131},
+ {0x0134,0x013E}, {0x0141,0x0148}, {0x014A,0x017E}, {0x0180,0x01C3}, {0x01CD,0x01F0}, {0x01F4,0x01F5},
+ {0x01FA,0x0217}, {0x0250,0x02A8}, {0x02BB,0x02C1}, {0x0386,0x0386}, {0x0388,0x038A}, {0x038C,0x038C},
+ {0x038E,0x03A1}, {0x03A3,0x03CE}, {0x03D0,0x03D6}, {0x03DA,0x03DA}, {0x03DC,0x03DC}, {0x03DE,0x03DE},
+ {0x03E0,0x03E0}, {0x03E2,0x03F3}, {0x0401,0x040C}, {0x040E,0x044F}, {0x0451,0x045C}, {0x045E,0x0481},
+ {0x0490,0x04C4}, {0x04C7,0x04C8}, {0x04CB,0x04CC}, {0x04D0,0x04EB}, {0x04EE,0x04F5}, {0x04F8,0x04F9},
+ {0x0531,0x0556}, {0x0559,0x0559}, {0x0561,0x0586}, {0x05D0,0x05EA}, {0x05F0,0x05F2}, {0x0621,0x063A},
+ {0x0641,0x064A}, {0x0671,0x06B7}, {0x06BA,0x06BE}, {0x06C0,0x06CE}, {0x06D0,0x06D3}, {0x06D5,0x06D5},
+ {0x06E5,0x06E6}, {0x0905,0x0939}, {0x093D,0x093D}, {0x0958,0x0961}, {0x0985,0x098C}, {0x098F,0x0990},
+ {0x0993,0x09A8}, {0x09AA,0x09B0}, {0x09B2,0x09B2}, {0x09B6,0x09B9}, {0x09DC,0x09DD}, {0x09DF,0x09E1},
+ {0x09F0,0x09F1}, {0x0A05,0x0A0A}, {0x0A0F,0x0A10}, {0x0A13,0x0A28}, {0x0A2A,0x0A30}, {0x0A32,0x0A33},
+ {0x0A35,0x0A36}, {0x0A38,0x0A39}, {0x0A59,0x0A5C}, {0x0A5E,0x0A5E}, {0x0A72,0x0A74}, {0x0A85,0x0A8B},
+ {0x0A8D,0x0A8D}, {0x0A8F,0x0A91}, {0x0A93,0x0AA8}, {0x0AAA,0x0AB0}, {0x0AB2,0x0AB3}, {0x0AB5,0x0AB9},
+ {0x0ABD,0x0ABD}, {0x0AE0,0x0AE0}, {0x0B05,0x0B0C}, {0x0B0F,0x0B10}, {0x0B13,0x0B28}, {0x0B2A,0x0B30},
+ {0x0B32,0x0B33}, {0x0B36,0x0B39}, {0x0B3D,0x0B3D}, {0x0B5C,0x0B5D}, {0x0B5F,0x0B61}, {0x0B85,0x0B8A},
+ {0x0B8E,0x0B90}, {0x0B92,0x0B95}, {0x0B99,0x0B9A}, {0x0B9C,0x0B9C}, {0x0B9E,0x0B9F}, {0x0BA3,0x0BA4},
+ {0x0BA8,0x0BAA}, {0x0BAE,0x0BB5}, {0x0BB7,0x0BB9}, {0x0C05,0x0C0C}, {0x0C0E,0x0C10}, {0x0C12,0x0C28},
+ {0x0C2A,0x0C33}, {0x0C35,0x0C39}, {0x0C60,0x0C61}, {0x0C85,0x0C8C}, {0x0C8E,0x0C90}, {0x0C92,0x0CA8},
+ {0x0CAA,0x0CB3}, {0x0CB5,0x0CB9}, {0x0CDE,0x0CDE}, {0x0CE0,0x0CE1}, {0x0D05,0x0D0C}, {0x0D0E,0x0D10},
+ {0x0D12,0x0D28}, {0x0D2A,0x0D39}, {0x0D60,0x0D61}, {0x0E01,0x0E2E}, {0x0E30,0x0E30}, {0x0E32,0x0E33},
+ {0x0E40,0x0E45}, {0x0E81,0x0E82}, {0x0E84,0x0E84}, {0x0E87,0x0E88}, {0x0E8A,0x0E8A}, {0x0E8D,0x0E8D},
+ {0x0E94,0x0E97}, {0x0E99,0x0E9F}, {0x0EA1,0x0EA3}, {0x0EA5,0x0EA5}, {0x0EA7,0x0EA7}, {0x0EAA,0x0EAB},
+ {0x0EAD,0x0EAE}, {0x0EB0,0x0EB0}, {0x0EB2,0x0EB3}, {0x0EBD,0x0EBD}, {0x0EC0,0x0EC4}, {0x0F40,0x0F47},
+ {0x0F49,0x0F69}, {0x10A0,0x10C5}, {0x10D0,0x10F6}, {0x1100,0x1100}, {0x1102,0x1103}, {0x1105,0x1107},
+ {0x1109,0x1109}, {0x110B,0x110C}, {0x110E,0x1112}, {0x113C,0x113C}, {0x113E,0x113E}, {0x1140,0x1140},
+ {0x114C,0x114C}, {0x114E,0x114E}, {0x1150,0x1150}, {0x1154,0x1155}, {0x1159,0x1159}, {0x115F,0x1161},
+ {0x1163,0x1163}, {0x1165,0x1165}, {0x1167,0x1167}, {0x1169,0x1169}, {0x116D,0x116E}, {0x1172,0x1173},
+ {0x1175,0x1175}, {0x119E,0x119E}, {0x11A8,0x11A8}, {0x11AB,0x11AB}, {0x11AE,0x11AF}, {0x11B7,0x11B8},
+ {0x11BA,0x11BA}, {0x11BC,0x11C2}, {0x11EB,0x11EB}, {0x11F0,0x11F0}, {0x11F9,0x11F9}, {0x1E00,0x1E9B},
+ {0x1EA0,0x1EF9}, {0x1F00,0x1F15}, {0x1F18,0x1F1D}, {0x1F20,0x1F45}, {0x1F48,0x1F4D}, {0x1F50,0x1F57},
+ {0x1F59,0x1F59}, {0x1F5B,0x1F5B}, {0x1F5D,0x1F5D}, {0x1F5F,0x1F7D}, {0x1F80,0x1FB4}, {0x1FB6,0x1FBC},
+ {0x1FBE,0x1FBE}, {0x1FC2,0x1FC4}, {0x1FC6,0x1FCC}, {0x1FD0,0x1FD3}, {0x1FD6,0x1FDB}, {0x1FE0,0x1FEC},
+ {0x1FF2,0x1FF4}, {0x1FF6,0x1FFC}, {0x2126,0x2126}, {0x212A,0x212B}, {0x212E,0x212E}, {0x2180,0x2182},
+ {0x3041,0x3094}, {0x30A1,0x30FA}, {0x3105,0x312C}, {0xAC00,0xD7A3}
+};
+
+
+static const CodePointRange_t ideographic_range[] =
+{
+ {0x4E00,0x9FA5} , {0x3007, 0x3007} , {0x3021,0x3029}
+};
+
+
+static const CodePointRange_t combining_char_range[] =
+{
+ {0x0300,0x0345}, {0x0360,0x0361}, {0x0483,0x0486}, {0x0591,0x05A1}, {0x05A3,0x05B9}, {0x05BB,0x05BD},
+ {0x05BF,0x05BF}, {0x05C1,0x05C2}, {0x05C4,0x05C4}, {0x064B,0x0652}, {0x0670,0x0670}, {0x06D6,0x06DC},
+ {0x06DD,0x06DF}, {0x06E0,0x06E4}, {0x06E7,0x06E8}, {0x06EA,0x06ED}, {0x0901,0x0903}, {0x093C,0x093C},
+ {0x093E,0x094C}, {0x094D,0x094D}, {0x0951,0x0954}, {0x0962,0x0963}, {0x0981,0x0983}, {0x09BC,0x09BC},
+ {0x09BE,0x09BE}, {0x09BF,0x09BF}, {0x09C0,0x09C4}, {0x09C7,0x09C8}, {0x09CB,0x09CD}, {0x09D7,0x09D7},
+ {0x09E2,0x09E3}, {0x0A02,0x0A02}, {0x0A3C,0x0A3C}, {0x0A3E,0x0A3E}, {0x0A3F,0x0A3F}, {0x0A40,0x0A42},
+ {0x0A47,0x0A48}, {0x0A4B,0x0A4D}, {0x0A70,0x0A71}, {0x0A81,0x0A83}, {0x0ABC,0x0ABC}, {0x0ABE,0x0AC5},
+ {0x0AC7,0x0AC9}, {0x0ACB,0x0ACD}, {0x0B01,0x0B03}, {0x0B3C,0x0B3C}, {0x0B3E,0x0B43}, {0x0B47,0x0B48},
+ {0x0B4B,0x0B4D}, {0x0B56,0x0B57}, {0x0B82,0x0B83}, {0x0BBE,0x0BC2}, {0x0BC6,0x0BC8}, {0x0BCA,0x0BCD},
+ {0x0BD7,0x0BD7}, {0x0C01,0x0C03}, {0x0C3E,0x0C44}, {0x0C46,0x0C48}, {0x0C4A,0x0C4D}, {0x0C55,0x0C56},
+ {0x0C82,0x0C83}, {0x0CBE,0x0CC4}, {0x0CC6,0x0CC8}, {0x0CCA,0x0CCD}, {0x0CD5,0x0CD6}, {0x0D02,0x0D03},
+ {0x0D3E,0x0D43}, {0x0D46,0x0D48}, {0x0D4A,0x0D4D}, {0x0D57,0x0D57}, {0x0E31,0x0E31}, {0x0E34,0x0E3A},
+ {0x0E47,0x0E4E}, {0x0EB1,0x0EB1}, {0x0EB4,0x0EB9}, {0x0EBB,0x0EBC}, {0x0EC8,0x0ECD}, {0x0F18,0x0F19},
+ {0x0F35,0x0F35}, {0x0F37,0x0F37}, {0x0F39,0x0F39}, {0x0F3E,0x0F3E}, {0x0F3F,0x0F3F}, {0x0F71,0x0F84},
+ {0x0F86,0x0F8B}, {0x0F90,0x0F95}, {0x0F97,0x0F97}, {0x0F99,0x0FAD}, {0x0FB1,0x0FB7}, {0x0FB9,0x0FB9},
+ {0x20D0,0x20DC}, {0x20E1,0x20E1}, {0x302A,0x302F}, {0x3099,0x3099}, {0x309A,0x309A}
+};
+
+
+static const CodePointRange_t digit_range[] =
+{
+ {0x0030,0x0039}, {0x0660,0x0669}, {0x06F0,0x06F9}, {0x0966,0x096F}, {0x09E6,0x09EF}, {0x0A66,0x0A6F},
+ {0x0AE6,0x0AEF}, {0x0B66,0x0B6F}, {0x0BE7,0x0BEF}, {0x0C66,0x0C6F}, {0x0CE6,0x0CEF}, {0x0D66,0x0D6F},
+ {0x0E50,0x0E59}, {0x0ED0,0x0ED9}, {0x0F20,0x0F29}
+};
+
+
+static const CodePointRange_t extender_range[] =
+{
+ {0x00B7,0x00B7}, {0x02D0,0x02D0}, {0x02D1,0x02D1}, {0x0387,0x0387}, {0x0640,0x0640}, {0x0E46,0x0E46},
+ {0x0EC6,0x0EC6}, {0x3005,0x3005}, {0x3031,0x3035}, {0x309D,0x309E}, {0x30FC,0x30FE}
+};
+
+
+
+
+
+/*
+Letter ::= BaseChar | Ideographic
+BaseChar ::= [#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6]
+ | [#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] | [#x014A-#x017E]
+ | [#x0180-#x01C3] | [#x01CD-#x01F0] | [#x01F4-#x01F5] | [#x01FA-#x0217] | [#x0250-#x02A8]
+ | [#x02BB-#x02C1] | #x0386 | [#x0388-#x038A] | #x038C | [#x038E-#x03A1] | [#x03A3-#x03CE]
+ | [#x03D0-#x03D6] | #x03DA | #x03DC | #x03DE | #x03E0 | [#x03E2-#x03F3] | [#x0401-#x040C]
+ | [#x040E-#x044F] | [#x0451-#x045C] | [#x045E-#x0481] | [#x0490-#x04C4] | [#x04C7-#x04C8]
+ | [#x04CB-#x04CC] | [#x04D0-#x04EB] | [#x04EE-#x04F5] | [#x04F8-#x04F9] | [#x0531-#x0556]
+ | #x0559 | [#x0561-#x0586] | [#x05D0-#x05EA] | [#x05F0-#x05F2] | [#x0621-#x063A]
+ | [#x0641-#x064A] | [#x0671-#x06B7] | [#x06BA-#x06BE] | [#x06C0-#x06CE] | [#x06D0-#x06D3]
+ | #x06D5 | [#x06E5-#x06E6] | [#x0905-#x0939] | #x093D | [#x0958-#x0961] | [#x0985-#x098C]
+ | [#x098F-#x0990] | [#x0993-#x09A8] | [#x09AA-#x09B0] | #x09B2 | [#x09B6-#x09B9]
+ | [#x09DC-#x09DD] | [#x09DF-#x09E1] | [#x09F0-#x09F1] | [#x0A05-#x0A0A] | [#x0A0F-#x0A10]
+ | [#x0A13-#x0A28] | [#x0A2A-#x0A30] | [#x0A32-#x0A33] | [#x0A35-#x0A36] | [#x0A38-#x0A39]
+ | [#x0A59-#x0A5C] | #x0A5E | [#x0A72-#x0A74] | [#x0A85-#x0A8B] | #x0A8D | [#x0A8F-#x0A91]
+ | [#x0A93-#x0AA8] | [#x0AAA-#x0AB0] | [#x0AB2-#x0AB3] | [#x0AB5-#x0AB9] | #x0ABD | #x0AE0
+ | [#x0B05-#x0B0C] | [#x0B0F-#x0B10] | [#x0B13-#x0B28] | [#x0B2A-#x0B30] | [#x0B32-#x0B33]
+ | [#x0B36-#x0B39] | #x0B3D | [#x0B5C-#x0B5D] | [#x0B5F-#x0B61] | [#x0B85-#x0B8A]
+ | [#x0B8E-#x0B90] | [#x0B92-#x0B95] | [#x0B99-#x0B9A] | #x0B9C | [#x0B9E-#x0B9F]
+ | [#x0BA3-#x0BA4] | [#x0BA8-#x0BAA] | [#x0BAE-#x0BB5] | [#x0BB7-#x0BB9] | [#x0C05-#x0C0C]
+ | [#x0C0E-#x0C10] | [#x0C12-#x0C28] | [#x0C2A-#x0C33] | [#x0C35-#x0C39] | [#x0C60-#x0C61]
+ | [#x0C85-#x0C8C] | [#x0C8E-#x0C90] | [#x0C92-#x0CA8] | [#x0CAA-#x0CB3] | [#x0CB5-#x0CB9]
+ | #x0CDE | [#x0CE0-#x0CE1] | [#x0D05-#x0D0C] | [#x0D0E-#x0D10] | [#x0D12-#x0D28]
+ | [#x0D2A-#x0D39] | [#x0D60-#x0D61] | [#x0E01-#x0E2E] | #x0E30 | [#x0E32-#x0E33]
+ | [#x0E40-#x0E45] | [#x0E81-#x0E82] | #x0E84 | [#x0E87-#x0E88] | #x0E8A | #x0E8D
+ | [#x0E94-#x0E97] | [#x0E99-#x0E9F] | [#x0EA1-#x0EA3] | #x0EA5 | #x0EA7 | [#x0EAA-#x0EAB]
+ | [#x0EAD-#x0EAE] | #x0EB0 | [#x0EB2-#x0EB3] | #x0EBD | [#x0EC0-#x0EC4] | [#x0F40-#x0F47]
+ | [#x0F49-#x0F69] | [#x10A0-#x10C5] | [#x10D0-#x10F6] | #x1100 | [#x1102-#x1103]
+ | [#x1105-#x1107] | #x1109 | [#x110B-#x110C] | [#x110E-#x1112] | #x113C | #x113E | #x1140
+ | #x114C | #x114E | #x1150 | [#x1154-#x1155] | #x1159 | [#x115F-#x1161] | #x1163 | #x1165
+ | #x1167 | #x1169 | [#x116D-#x116E] | [#x1172-#x1173] | #x1175 | #x119E | #x11A8 | #x11AB
+ | [#x11AE-#x11AF] | [#x11B7-#x11B8] | #x11BA | [#x11BC-#x11C2] | #x11EB | #x11F0 | #x11F9
+ | [#x1E00-#x1E9B] | [#x1EA0-#x1EF9] | [#x1F00-#x1F15] | [#x1F18-#x1F1D] | [#x1F20-#x1F45]
+ | [#x1F48-#x1F4D] | [#x1F50-#x1F57] | #x1F59 | #x1F5B | #x1F5D | [#x1F5F-#x1F7D]
+ | [#x1F80-#x1FB4] | [#x1FB6-#x1FBC] | #x1FBE | [#x1FC2-#x1FC4] | [#x1FC6-#x1FCC]
+ | [#x1FD0-#x1FD3] | [#x1FD6-#x1FDB] | [#x1FE0-#x1FEC] | [#x1FF2-#x1FF4] | [#x1FF6-#x1FFC]
+ | #x2126 | [#x212A-#x212B] | #x212E | [#x2180-#x2182] | [#x3041-#x3094] | [#x30A1-#x30FA]
+ | [#x3105-#x312C] | [#xAC00-#xD7A3]
+Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
+*/
+bool XQCharType::isLetter(uint32_t cp)
+{
+ return isBaseChar(cp) || isIdeographic(cp);
+}
+
+
+/*******************************************************************************
+
+********************************************************************************/
+bool XQCharType::isBaseChar(uint32_t cp)
+{
+ unsigned int i;
+ for(i=0;i<sizeof(base_char_range)/sizeof(CodePointRange_t);i++)
+ {
+ if(cp < base_char_range[i].left)
+ return false;
+ if(cp <= base_char_range[i].right)
+ return true;
+ }
+
+ return false;
+}
+
+
+/*******************************************************************************
+
+********************************************************************************/
+bool XQCharType::isIdeographic(uint32_t cp)
+{
+ unsigned int i;
+ for(i=0;i<sizeof(ideographic_range)/sizeof(CodePointRange_t);i++)
+ {
+ if(cp < ideographic_range[i].left)
+ return false;
+ if(cp <= ideographic_range[i].right)
+ return true;
+ }
+
+ return false;
+}
+
+
+/*******************************************************************************
+
+********************************************************************************/
+bool XQCharType::isDigit(uint32_t cp)
+{
+ unsigned int i;
+ for(i=0;i<sizeof(digit_range)/sizeof(CodePointRange_t);i++)
+ {
+ if(cp < digit_range[i].left)
+ return false;
+ if(cp <= digit_range[i].right)
+ return true;
+ }
+
+ return false;
+}
+
+
+/*******************************************************************************
+
+********************************************************************************/
+bool XQCharType::isCombiningChar(uint32_t cp)
+{
+ unsigned int i;
+ for(i = 0; i < sizeof(combining_char_range)/sizeof(CodePointRange_t); i++)
+ {
+ if(cp < combining_char_range[i].left)
+ return false;
+ if(cp <= combining_char_range[i].right)
+ return true;
+ }
+
+ return false;
+}
+
+
+/*******************************************************************************
+
+********************************************************************************/
+bool XQCharType::isExtender(uint32_t cp)
+{
+ unsigned int i;
+ for(i = 0 ; i < sizeof(extender_range)/sizeof(CodePointRange_t); ++i)
+ {
+ if(cp < extender_range[i].left)
+ return false;
+
+ if(cp <= extender_range[i].right)
+ return true;
+ }
+
+ return false;
+}
+
+bool XQCharType::isNameChar(uint32_t cp)
+{
+ return (cp == '.') || (cp == '-') || (cp == '_') || (cp == ':') ||
+ isLetter(cp) || isDigit(cp) || isCombiningChar(cp) || isExtender(cp);
+}
+
+}//end namespace zorba
+
+
+////////////////////////////////////////////
+///////////////////////////////////////////////
+///////////////////////////////////////////////////
+////////////////////////////////////////////////////////
+
+namespace zorba{
+
+
+unsigned int utf8_sequence_length(const char* lead_it)
+{
+ unsigned char lead = *lead_it;
+ if (lead < 0x80)
+ return 1;
+ else if ((lead >> 5) == 0x6)
+ return 2;
+ else if ((lead >> 4) == 0xe)
+ return 3;
+ else if ((lead >> 3) == 0x1e)
+ return 4;
+ else if ((lead >> 2) == 0x3e)
+ return 5;
+ else if ((lead >> 1) == 0x7e)
+ return 6;
+ else
+ return 1;
+}
+
+uint32_t utf8_to_codepoint(const char* it)
+{
+ uint32_t cp = *it;
+
+ unsigned int length = utf8_sequence_length(it);
+ switch (length) {
+ case 1:
+ break;
+ case 2:
+ it++;
+ cp = ((cp << 6) & 0x7ff) + ((*it) & 0x3f);
+ break;
+ case 3:
+ ++it;
+ cp = ((cp << 12) & 0xffff) + ((*it << 6) & 0xfff);
+ ++it;
+ cp += (*it) & 0x3f;
+ break;
+ case 4:
+ ++it;
+ cp = ((cp << 18) & 0x1fffff) + ((*it << 12) & 0x3ffff);
+ ++it;
+ cp += (*it << 6) & 0xfff;
+ ++it;
+ cp += (*it) & 0x3f;
+ break;
+ case 5:
+ ++it;
+ cp = ((cp&0x03) << 24) + ((*it)&0x3F << 18);
+ ++it;
+ cp += (*it)&0x3F << 12;
+ ++it;
+ cp += (*it)&0x3F << 6;
+ ++it;
+ cp += (*it)&0x3f;
+ break;
+ case 6:
+ ++it;
+ cp = ((cp&0x01) << 30) + ((*it)&0x3F << 24);
+ ++it;
+ cp += (*it)&0x3F << 18;
+ ++it;
+ cp += (*it)&0x3F << 12;
+ ++it;
+ cp += (*it)&0x3F << 6;
+ ++it;
+ cp += (*it)&0x3f;
+ break;
+ }
+ return cp;
+}
+
+
+bool isQNameCharacter(uint32_t cp, int position, bool &bad_for_first_char)
+{
+ if (XQCharType::isLetter(cp) || cp == '_')
+ return true;
+
+ if (XQCharType::isDigit(cp)
+ || XQCharType::isExtender(cp)
+ || XQCharType::isCombiningChar(cp)
+ || cp == '.'
+ || cp == '-')
+ {
+ if (position == 0)
+ {
+ bad_for_first_char = true;
+ return false;
+ }
+ return true;
+ }
+ bad_for_first_char = false;
+ return false;
+}
+
+
+String encodeStringToQNameString(std::string &str)
+{
+ const char *cstr = str.c_str();
+ uint32_t cp;
+ std::string result;
+ int position = 0;
+ unsigned int cp_len;
+ bool bad_for_first_char;
+ result.reserve(str.length()+1);
+ while(*cstr)
+ {
+ cp_len = utf8_sequence_length(cstr);
+ cp = utf8_to_codepoint(cstr);
+ if(isQNameCharacter(cp, position, bad_for_first_char))
+ result.append(cstr, cp_len);
+ else
+ {
+ result.append("_");
+ if(bad_for_first_char)
+ {
+ result.append(cstr, cp_len);
+ }
+ }
+ position++;
+ cstr += cp_len;
+ }
+ return result;
+}
+
+}//end namespace zorba
\ No newline at end of file
=== added file 'src/com/zorba-xquery/www/modules/converters/csv.xq.src/csv.cpp'
--- src/com/zorba-xquery/www/modules/converters/csv.xq.src/csv.cpp 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/csv.xq.src/csv.cpp 2011-12-06 07:32:41 +0000
@@ -0,0 +1,1406 @@
+/*
+ * Copyright 2006-2008 The FLWOR 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.
+ */
+
+#include <sstream>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <vector>
+#include <iostream>
+#include <limits.h>
+#include <string.h>
+#include <assert.h>
+
+#include <zorba/zorba.h>
+#include <zorba/store_consts.h>
+#include <zorba/diagnostic_list.h>
+#include <zorba/user_exception.h>
+#include <zorba/item_factory.h>
+#include <zorba/singleton_item_sequence.h>
+#include <zorba/empty_sequence.h>
+#include <zorba/zorba_functions.h>
+#include <zorba/file.h>
+
+#include "csv.h"
+
+namespace zorba{
+String encodeStringToQNameString(std::string &str);
+unsigned int utf8_sequence_length(const char* lead_it);
+}
+
+namespace zorba { namespace csv {
+
+ItemFactory* CSVModule::theFactory = 0;
+
+
+CSVModule::CSVModule()
+{
+ lParseFunc = NULL;
+ lSerializeFunc = NULL;
+}
+
+ExternalFunction*
+CSVModule::getExternalFunction(const zorba::String &aLocalname)
+{
+ if (1 == 0) {
+ }
+ else if (aLocalname == "parse-internal") {
+ lParseFunc = new CSVParseFunction(this);
+ return lParseFunc;
+ }
+ else if (aLocalname == "serialize-internal") {
+ lSerializeFunc = new CSVSerializeFunction(this);
+ return lSerializeFunc;
+ }
+ return NULL;
+}
+
+const char* CSVModule::theModule = "http://www.zorba-xquery.com/modules/converters/csv";
+
+void
+CSVModule::destroy()
+{
+ if (!dynamic_cast<CSVModule*>(this)) {
+ return;
+ }
+ delete this;
+}
+
+bool compareItemQName(Item item, const char *localname, const char *ns)
+{
+ int node_kind = item.getNodeKind();
+ if(node_kind != store::StoreConsts::elementNode)
+ return false;
+ Item node_name;
+ item.getNodeName(node_name);
+ String item_namespace = node_name.getNamespace();
+ if(ns && ns[0] && item_namespace != ns )
+ {
+ return false;
+ }
+ String item_name = node_name.getLocalName();
+ if(item_name != localname)
+ {
+ return false;
+ }
+ return true;
+}
+
+bool getChild(zorba::Iterator_t children, const char *localname, const char *ns,
+ zorba::Item &child_item);
+bool getChild(zorba::Item &lItem, const char *localname, const char *ns,
+ zorba::Item &child_item)
+{
+ Iterator_t children;
+ children = lItem.getChildren();
+ children->open();
+ bool retval = getChild(children, localname, ns, child_item);
+ children->close();
+ return retval;
+}
+
+bool getChild(zorba::Iterator_t children, const char *localname, const char *ns,
+ zorba::Item &child_item)
+{
+ while(children->next(child_item))
+ {
+ if(child_item.getNodeKind() != store::StoreConsts::elementNode)
+ continue;
+ Item child_name;
+ child_item.getNodeName(child_name);
+ String item_namespace = child_name.getNamespace();
+ if(item_namespace != ns)
+ {
+ continue;//next child
+ }
+ String item_name = child_name.getLocalName();
+ if(item_name != localname)
+ {
+ continue;//next child
+ }
+ return true;
+ }
+ return false;
+}
+
+bool getAttribute(Item element, const char *lookup_name, String &attr_value)
+{
+ Iterator_t attrs;
+ attrs = element.getAttributes();
+ attrs->open();
+ Item attr;
+ while(attrs->next(attr))
+ {
+ Item attr_name;
+ attr.getNodeName(attr_name);
+ String attr_localname;
+ attr_localname = attr_name.getLocalName();
+ if(!strcmp(attr_localname.c_str(), lookup_name))
+ {
+ attr_value = attr.getStringValue();
+ return true;
+ }
+ }
+ attrs->close();
+ return false;
+}
+
+void addIndentation(Item parent, unsigned int indent_level,
+ ItemFactory *item_factory)
+{
+ return;
+/*
+ if(indent_level > 100)
+ indent_level = 100;
+ char ws[110];
+ ws[0] = '\n';
+ memset(ws+1, ' ', indent_level);
+ ws[indent_level+1] = 0;
+ item_factory->createTextNode(parent, ws);
+*/
+}
+
+///////////////////////////////////////////////////////////////////////////
+
+/****************************************
+ CSV to XML convertor
+**************************************/
+CSVOptions::CSVOptions()
+{
+ separator = ",";
+ quote_char = "\"";//double quotes
+ quote_escape = "\"\"";//double double quotes
+ first_row_is_header = 0;//not header
+ last_subheader_row = 0;
+ start_from_row = 1;
+ last_row = 0;
+ column_specified = false;
+ add_last_void_columns = false;
+ ignore_foreign_input = false;
+ accept_all_lines = false;
+ //row_name = "row";
+ //column_name = "column";
+ last_column_position_is_computed = false;
+}
+
+void CSVOptions::parse(zorba::Item options_node, ItemFactory *item_factory)
+{
+ String empty_string;
+ row_qname = item_factory->createQName(empty_string, empty_string, "row");
+ column_qname = item_factory->createQName(empty_string, empty_string, "column");
+
+ if(!options_node.isNull())
+ {
+ if(!compareItemQName(options_node, "options", ""))
+ {
+ std::stringstream lErrorMessage;
+ Item options_qname;
+ options_node.getNodeName(options_qname);
+ lErrorMessage << "Options field must be of element options instead of " << options_qname.getStringValue();
+ Item errWrongParamQName;
+ String errName("WrongParam");
+ errWrongParamQName = item_factory->createQName(CSVModule::theModule, errName);
+ String errDescription(lErrorMessage.str());
+ throw USER_EXCEPTION(errWrongParamQName, errDescription);
+ }
+ zorba::Item xmlnode_item;
+ if(getChild(options_node, "xml-nodes", "", xmlnode_item))
+ {
+ //the first child is the row name (if it exists)
+ //then the first child of the first child is the column name (if it exists)
+ Iterator_t children;
+ children = xmlnode_item.getChildren();
+ children->open();
+ Item row_item;
+ while(children->next(row_item))
+ {
+ int column_kind = row_item.getNodeKind();
+ if(column_kind != store::StoreConsts::elementNode)
+ continue;
+ row_item.getNodeName(row_qname);
+ Iterator_t children;
+ children = row_item.getChildren();
+ children->open();
+ Item column_item;
+ while(children->next(column_item))
+ {
+ int column_kind = column_item.getNodeKind();
+ if(column_kind != store::StoreConsts::elementNode)
+ continue;
+ column_item.getNodeName(column_qname);
+ column_specified = true;
+ break;
+ }
+ children->close();
+ break;
+ }
+ children->close();
+ }
+ zorba::Item columns_item;
+ if(getChild(options_node, "column-widths", "", columns_item))
+ {
+ bool align_right = false;
+ int last_pos = 1;
+ column_positions.push_back(1);
+
+ String attr_value;
+ if(getAttribute(columns_item, "align", attr_value))
+ {
+ if(attr_value == "right")
+ align_right = true;
+ }
+ Iterator_t children;
+ children = columns_item.getChildren();
+ children->open();
+ Item column_item;
+ while(children->next(column_item))
+ {
+ if(compareItemQName(column_item, "column-width", ""))
+ {
+ String column_text = column_item.getStringValue();
+ const char *column_str = column_text.c_str();
+ while(*column_str && isascii(*column_str) && isspace(*column_str))
+ column_str++;
+ unsigned int width = abs(atoi(column_str));
+ last_pos += width;
+ column_positions.push_back(last_pos);
+ if(getAttribute(column_item, "align", attr_value))
+ {
+ if(attr_value == "right")
+ aligns.push_back(true);
+ else
+ aligns.push_back(false);
+ }
+ else
+ aligns.push_back(align_right);
+ }
+ }
+ children->close();
+ last_column_position_is_computed = true;
+ }
+ else if(getChild(options_node, "column-positions", "", columns_item))
+ {
+ bool align_right = false;
+ String attr_value;
+ if(getAttribute(columns_item, "align", attr_value))
+ {
+ if(attr_value == "right")
+ align_right = true;
+ }
+ Iterator_t children;
+ children = columns_item.getChildren();
+ children->open();
+ Item column_item;
+ while(children->next(column_item))
+ {
+ if(compareItemQName(column_item, "column-position", ""))
+ {
+ String column_text = column_item.getStringValue();
+ const char *column_str = column_text.c_str();
+ while(*column_str && isascii(*column_str) && isspace(*column_str))
+ column_str++;
+ unsigned int position = abs(atoi(column_str));
+ if((column_positions.size() == 0) && position > 1)
+ column_positions.push_back(1);
+ column_positions.push_back(position);
+ if(getAttribute(column_item, "align", attr_value))
+ {
+ if(attr_value == "right")
+ aligns.push_back(true);
+ else
+ aligns.push_back(false);
+ }
+ else
+ aligns.push_back(align_right);
+ }
+ }
+ children->close();
+ }
+ else if(getChild(options_node, "csv", "", columns_item))
+ {
+ String attr_value;
+ if(getAttribute(columns_item, "separator", attr_value))
+ {
+ separator = attr_value.c_str();
+ }
+ if(getAttribute(columns_item, "quote-char", attr_value))
+ {
+ quote_char = attr_value.c_str();
+ }
+ if(getAttribute(columns_item, "quote-escape", attr_value))
+ {
+ quote_escape= attr_value.c_str();
+ }
+ }
+
+ Item first_header_item;
+ if(getChild(options_node, "first-row-is-header", "", first_header_item))
+ {
+ first_row_is_header = 1;
+ String attr_value;
+ if(getAttribute(first_header_item, "line", attr_value))
+ {
+ const char *attr_str = attr_value.c_str();
+ while(*attr_str && isascii(*attr_str) && isspace(*attr_str))
+ attr_str++;
+ int lineval = atoi(attr_str);
+ if(lineval > 0)
+ first_row_is_header = lineval;
+ const char *subheader = strchr(attr_str, '-');
+ if(subheader && *subheader)
+ {
+ subheader++;
+ while(*subheader && isascii(*subheader) && isspace(*subheader))
+ subheader++;
+ last_subheader_row = atoi(subheader);
+ if(last_subheader_row <= first_row_is_header)
+ last_subheader_row = 0;
+ }
+ }
+ if(getAttribute(first_header_item, "ignore-foreign-input", attr_value))
+ {
+ const char *attr_str = attr_value.c_str();
+ if(!strcmp(attr_str, "true"))
+ ignore_foreign_input = true;
+ }
+ if(getAttribute(first_header_item, "accept-all-lines", attr_value))
+ {
+ const char *attr_str = attr_value.c_str();
+ if(!strcmp(attr_str, "true"))
+ accept_all_lines = true;
+ }
+ }
+ Item start_row_item;
+ if(getChild(options_node, "start-from-row", "", start_row_item))
+ {
+ String attr_value;
+ if(getAttribute(start_row_item, "line", attr_value))
+ {
+ const char *attr_str = attr_value.c_str();
+ while(*attr_str && isascii(*attr_str) && isspace(*attr_str))
+ attr_str++;
+ int lineval = atoi(attr_str);
+ if(lineval > 0)
+ start_from_row = lineval;
+ if(first_row_is_header > start_from_row)
+ first_row_is_header = start_from_row;
+ const char *last = strchr(attr_str, '-');
+ if(last && *last)
+ {
+ last++;
+ while(*last && isascii(*last) && isspace(*last))
+ last++;
+ last_row = atoi(last);
+ if(last_row <= start_from_row)
+ last_row = 0;
+ }
+ }
+ }
+ Item add_last_col_item;
+ if(getChild(options_node, "add-last-void-columns", "", add_last_col_item))
+ add_last_void_columns = true;
+ }
+
+ separator_size = (unsigned int)separator.length();
+ quote_char_size = (unsigned int)quote_char.length();
+ quote_escape_size = (unsigned int)quote_escape.length();
+ if(!quote_char_size)
+ quote_escape_size = 0;
+}
+
+void CSVParseFunction::CSVItemSequence::init(Item string_item,
+ ItemFactory *item_factory)
+{
+ if ( string_item.isStreamable() ) {
+ unsigned int max_len = csv_options.separator_size;
+ if(max_len < csv_options.quote_char_size)
+ max_len = csv_options.quote_char_size;
+ if(max_len < csv_options.quote_escape_size)
+ max_len = csv_options.quote_escape_size;
+ input_stream = new StreamWrapper(string_item, max_len);
+ } else {
+ input_stream = new CharPtrStream(string_item);
+ }
+ this->item_factory = item_factory;
+ line_index = 1;
+}
+
+void CSVParseFunction::CSVItemSequence::rtrim(std::string &field)
+{
+ const char *cstr = field.c_str();
+ size_t len = field.length();
+ const char *endstr = cstr + len-1;
+ while((endstr > cstr) && isascii(*endstr) && isspace(*endstr))
+ {
+ len--;
+ endstr--;
+ }
+ field.resize(len);
+}
+
+bool CSVParseFunction::CSVItemSequence::read_line(std::vector<std::string>& line) //OUT
+{
+ if(!csv_options.column_positions.size())
+ {
+ return csv_read_line(line);
+ }
+ else
+ {
+ return txt_read_line(line);
+ }
+}
+
+bool CSVParseFunction::CSVItemSequence::csv_read_line(std::vector<std::string>& line) //OUT
+{
+ //line.clear();
+ //read all fields until new line
+ //beware of quotes and quote escapes
+
+ bool is_empty_line = true;
+ bool is_within_quotes = false;
+ line.resize(1);
+ std::string *field = &line.back();
+ field->reserve(100);
+ while(!input_stream->is_end())
+ {
+ if(!is_within_quotes && input_stream->compare(csv_options.separator))
+ {
+ line.resize(line.size()+1);
+ field = &line.back();
+ field->reserve(100);
+ input_stream->skip(csv_options.separator_size);
+ }
+ else if((csv_options.quote_escape_size > 1) && input_stream->compare(csv_options.quote_escape))
+ {
+ field->append(csv_options.quote_char);
+ input_stream->skip(csv_options.quote_escape_size);
+ }
+ else if(csv_options.quote_char_size && input_stream->compare(csv_options.quote_char))
+ {
+ is_within_quotes = !is_within_quotes;
+ input_stream->skip(csv_options.quote_char_size);
+ }
+ else if(!is_within_quotes && ((*input_stream->get_utf8_seq() == '\n') || (*input_stream->get_utf8_seq() == '\r')))
+ {
+ while(!input_stream->is_end() && (((*input_stream->get_utf8_seq()) == '\r') || ((*input_stream->get_utf8_seq()) == '\n')))
+ {
+ input_stream->skip(1);
+ }
+ break;
+ }
+ else
+ {
+ unsigned int seq_len = input_stream->get_utf8_sequence_length();
+ field->append(input_stream->get_utf8_seq(), seq_len);
+ input_stream->skip(seq_len);
+ }
+ is_empty_line = false;
+ }
+
+ //if(field->empty())
+ // line.resize(line.size()-1);
+ return !is_empty_line;
+}
+
+bool CSVParseFunction::CSVItemSequence::txt_read_line(std::vector<std::string> &line)//OUT
+{
+ bool is_empty_line = true;
+ std::string *field = NULL;
+ //read all fields until new line
+
+ unsigned int pos = 1;
+ unsigned int column = 0;
+ size_t column_positions_size = csv_options.column_positions.size();
+ while(!input_stream->is_end())
+ {
+ const char *curent_char = input_stream->get_utf8_seq();
+ if((column < column_positions_size) &&
+ (pos >= csv_options.column_positions[column]))
+ {
+ if((column == (column_positions_size-1)) && csv_options.last_column_position_is_computed)
+ {
+ //premature finish of the line
+ while(!input_stream->is_end() && ((*curent_char != '\r') && (*curent_char != '\n')))
+ {
+ input_stream->skip(1);
+ curent_char = input_stream->get_utf8_seq();
+ }
+ while(!input_stream->is_end() && ((*curent_char == '\r') || (*curent_char == '\n')))
+ {
+ input_stream->skip(1);
+ curent_char = input_stream->get_utf8_seq();
+ }
+ break;
+ }
+ if(field)
+ rtrim(*field);
+ line.resize(line.size()+1);
+ field = &line.back();
+ field->reserve(100);
+
+ column++;
+
+ }
+
+ if((*curent_char == '\n') || (*curent_char == '\r'))
+ {
+ while(!input_stream->is_end() && ((*curent_char == '\r') || (*curent_char == '\n')))
+ {
+ input_stream->skip(1);
+ curent_char = input_stream->get_utf8_seq();
+ }
+ break;
+ }
+ else if(field && !field->length() && ((*curent_char == ' ') || (*curent_char == '\t')))
+ {
+ //ignore padding whitespace
+ input_stream->skip(1);
+ pos++;
+ }
+ else
+ {
+ unsigned int seq_len = input_stream->get_utf8_sequence_length();
+ if(field)
+ field->append(curent_char, seq_len);
+ input_stream->skip(seq_len);
+ pos++;
+ is_empty_line = false;
+ }
+ }
+
+ if(field)
+ rtrim(*field);
+ //if(field->empty())
+ // line.resize(line.size()-1);
+ return !is_empty_line;
+}
+
+void CSVParseFunction::CSVItemSequence::buildHeader(std::vector<std::vector<std::string> > &headers)
+{
+ HeaderNode* header_node;
+ header_qnames.resize(headers.at(0).size());
+ for(unsigned int i=0;i<headers.size();i++)
+ {
+ std::vector<std::string> &line = headers.at(i);
+ for(unsigned int j=0;j<line.size();j++)
+ {
+ std::string &header_name = line.at(j);
+ rtrim(header_name);
+ if(!header_name.empty())
+ {
+ header_node = new HeaderNode;
+ header_node->level = i;
+ header_node->start_pos = j;
+ String encoded_localname = encodeStringToQNameString(header_name);
+ if(csv_options.column_specified)
+ header_node->name = item_factory->createQName( csv_options.column_qname.getNamespace().c_str(),
+ csv_options.column_qname.getPrefix().c_str(),
+ encoded_localname);
+ else
+ header_node->name = item_factory->createQName( csv_options.row_qname.getNamespace().c_str(),
+ csv_options.row_qname.getPrefix().c_str(),
+ encoded_localname);
+ if(header_qnames[j] != NULL)
+ {
+ header_node->parent = header_qnames[j];
+ header_qnames[j]->children.push_back(header_node);
+ }
+ else if(i && j && (header_qnames[j-1] != NULL))
+ {
+ if(header_qnames[j-1]->level == i)
+ {
+ if(header_qnames[j-1]->parent != NULL)
+ {
+ header_node->parent = header_qnames[j-1]->parent;
+ header_qnames[j-1]->parent->children.push_back(header_node);
+ }
+ }
+ else
+ {
+ header_node->parent = header_qnames[j-1];
+ header_qnames[j-1]->children.push_back(header_node);
+ }
+ }
+ header_qnames[j] = header_node;
+ }
+ }
+ }
+
+ //now fill in the empty named columns
+ for(unsigned int i=0;i<header_qnames.size();i++)
+ {
+ if(header_qnames[i] == NULL)
+ {
+ char column_name[100];
+ sprintf(column_name, "column%d", i+1);
+ header_node = new HeaderNode;
+ header_node->level = i;
+ String encoded_localname = column_name;
+ if(csv_options.column_specified)
+ header_node->name = item_factory->createQName( csv_options.column_qname.getNamespace().c_str(),
+ csv_options.column_qname.getPrefix().c_str(),
+ encoded_localname);
+ else
+ header_node->name = item_factory->createQName( csv_options.row_qname.getNamespace().c_str(),
+ csv_options.row_qname.getPrefix().c_str(),
+ encoded_localname);
+ header_qnames[i] = header_node;
+ }
+ }
+}
+
+bool CSVParseFunction::CSVItemSequence::buildNodeTree(zorba::Item parent,
+ HeaderNode *current,
+ //std::vector<std::string> &line,
+ unsigned int &line_pos
+ //unsigned int indent_level,
+ //zorba::Item item_type,
+ //std::vector<std::pair<String, String> > &ns_binding
+ )
+{
+ zorba::Item fieldNode;
+ //zorba::Item textNode;
+
+ if(!csv_options.add_last_void_columns && (line_pos >= line.size()))
+ return false;
+// addIndentation(parent, indent_level, item_factory);
+
+ fieldNode = item_factory->createElementNode(parent, current->name, item_type, true, false, ns_binding);
+
+ if(current->children.size())
+ {
+ std::vector<HeaderNode*>::iterator children_it;
+ for(children_it = current->children.begin(); children_it != current->children.end(); children_it++)
+ {
+ while((*children_it)->start_pos > line_pos)
+ {
+ if(line_pos < line.size() && !line[line_pos].empty())
+ {
+ item_factory->createTextNode(fieldNode, line[line_pos]);
+ }
+ line_pos++;
+ }
+ buildNodeTree(fieldNode, (*children_it), line_pos);
+ }
+// addIndentation(fieldNode, indent_level, item_factory);
+ }
+ else
+ {
+ if(line_pos < line.size() && !line[line_pos].empty())
+ item_factory->createTextNode(fieldNode, line[line_pos]);
+ line_pos++;
+ }
+ return true;
+}
+
+CSVParseFunction::CSVItemSequence::CSVItemSequence()
+{
+ is_open = false;
+ open_count = 0;
+}
+
+void CSVParseFunction::CSVItemSequence::open()
+{
+ is_open = true;
+ if(open_count && !input_stream->reset())
+ {
+ std::stringstream lSs;
+ lSs << "Cannot reset input stream for CSVParseFunction for second iterator open";
+ Item lQName = CSVModule::getItemFactory()->createQName(CSVModule::theModule, "CSV001");
+ throw USER_EXCEPTION( lQName, lSs.str());
+ }
+ line_index = 1;
+ open_count++;
+
+ ns_binding.clear();
+ if(!csv_options.row_qname.getNamespace().empty())
+ {
+ ns_binding.push_back(std::pair<String, String>(csv_options.row_qname.getPrefix().c_str(),
+ csv_options.row_qname.getNamespace().c_str()));
+ }
+ item_type = item_factory->createQName("http://www.w3.org/2001/XMLSchema", "untyped");
+}
+
+void CSVParseFunction::CSVItemSequence::close()
+{
+ is_open = false;
+}
+
+bool CSVParseFunction::CSVItemSequence::isOpen() const
+{
+ return is_open;
+}
+
+bool CSVParseFunction::CSVItemSequence::next(Item& result)
+{
+ assert(is_open);
+
+ if(csv_options.first_row_is_header)
+ {
+ std::vector<std::vector<std::string> > headers;
+ headers.resize(1);
+ std::vector<std::string> &line = headers.back();
+ while(line_index <= csv_options.first_row_is_header)
+ {
+ line.clear();
+ if(!read_line(line))
+ return false;
+ line_index++;
+ }
+ if(csv_options.last_subheader_row)
+ {
+ do
+ {
+ headers.resize(headers.size()+1);
+ std::vector<std::string> &line = headers.back();
+ if(!read_line(line))
+ return false;
+ line_index++;
+ if(!csv_options.accept_all_lines)
+ {
+ if(line.size() != headers.at(0).size())
+ {
+ std::stringstream lErrorMessage;
+ lErrorMessage << "Header line " << line_index-1 << " has " << line.size() << " items instead of " << headers.at(0).size();
+ Item errWrongParamQName;
+ String errName("WrongInput");
+ errWrongParamQName = CSVModule::getItemFactory()->createQName(CSVModule::theModule, errName);
+ String errDescription(lErrorMessage.str());
+ throw USER_EXCEPTION(errWrongParamQName, errDescription);
+ }
+ }
+ }
+ while(line_index <= csv_options.last_subheader_row);
+ }
+
+ buildHeader(headers);
+ csv_options.first_row_is_header = 0;
+ }
+
+ if(csv_options.last_row && (line_index > csv_options.last_row))
+ return false;
+
+ //now read everything else
+ do
+ {
+ line.clear();
+ if(!read_line(line))
+ return false;
+ line_index++;
+ }
+ while(line_index <= csv_options.start_from_row);
+
+
+ result = item_factory->createElementNode(null_parent, csv_options.row_qname, item_type, true, false, ns_binding);
+
+ if(header_qnames.size())
+ {
+ if(!csv_options.accept_all_lines)
+ {
+ if(line.size() != header_qnames.size())
+ {
+ std::stringstream lErrorMessage;
+ lErrorMessage << "Line " << line_index-1 << " has " << line.size() << " items instead of " << header_qnames.size();
+ Item errWrongParamQName;
+ String errName("WrongInput");
+ errWrongParamQName = CSVModule::getItemFactory()->createQName(CSVModule::theModule, errName);
+ String errDescription(lErrorMessage.str());
+ throw USER_EXCEPTION(errWrongParamQName, errDescription);
+ }
+ }
+ unsigned int i;
+ unsigned int line_pos = 0;
+ HeaderNode *prev_parent = NULL;
+ for(i=0;i<header_qnames.size();i++)
+ {
+ HeaderNode *header = header_qnames[i];
+ HeaderNode *header_parent = header;
+ while(header_parent->parent)
+ header_parent = header_parent->parent;
+ if(header_parent == prev_parent)
+ continue;
+
+ if(!buildNodeTree(result, header_parent, line_pos))
+ break;
+ prev_parent = header_parent;
+ }
+ }
+ else
+ {
+ unsigned int i;
+ for(i = 0; i < line.size(); i++)
+ {
+ zorba::Item fieldNode;
+ //zorba::Item textNode;
+
+ addIndentation(result, 2, item_factory);
+
+ fieldNode = item_factory->createElementNode(result, csv_options.column_qname, item_type, true, false, ns_binding);
+
+ if(!line[i].empty())
+ item_factory->createTextNode(fieldNode, line[i]);
+ }
+ }
+
+//- if(line.size())
+//- item_factory->createTextNode(result, "\n");
+
+ return true;
+}
+
+zorba::ItemSequence_t
+CSVParseFunction::evaluate(const Arguments_t& args,
+ const zorba::StaticContext* sctx,
+ const zorba::DynamicContext* dctx) const
+{
+ Item string_item;
+ Iterator_t arg0_iter = args[0]->getIterator();
+ arg0_iter->open();
+ if (!arg0_iter->next(string_item))
+ {
+ std::stringstream lErrorMessage;
+ lErrorMessage << "An empty-sequence is not allowed as first parameter";
+ Item errWrongParamQName;
+ String errName("WrongParam");
+ errWrongParamQName = theModule->getItemFactory()->createQName(CSVModule::theModule, errName);
+ String errDescription(lErrorMessage.str());
+ throw USER_EXCEPTION(errWrongParamQName, errDescription);
+
+ }
+ arg0_iter->close();
+
+ Item options_item;
+ Iterator_t arg1_iter = args[1]->getIterator();
+ arg1_iter->open();
+ arg1_iter->next(options_item);
+ arg1_iter->close();
+
+ CSVItemSequence *out_sequence = new CSVItemSequence();
+ out_sequence->csv_options.parse(options_item, theModule->getItemFactory());
+ out_sequence->init(string_item, theModule->getItemFactory());
+
+ //out_sequence->baseUri = sctx->get_base_uri();
+ return ItemSequence_t(out_sequence);
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////
+//////////////////serialize
+CSVSerializeFunction::StringStreamSequence::StringStreamSequence(ItemSequence* input)
+ : input_iter(input->getIterator()),
+ is(new std::istream(this))
+{
+// input_nodes = input;
+ line_index = 0;
+ has_next = true;
+ is_open = false;
+ open_count = 0;
+ input_iter->open();
+}
+
+void CSVSerializeFunction::StringStreamSequence::csv_get_headers( Item node,
+ unsigned int level,
+ unsigned int &position)
+{
+ Iterator_t children = node.getChildren();
+ Item column;
+
+ children->open();
+ while(children->next(column))
+ {
+ int column_kind = column.getNodeKind();
+ if((column_kind != store::StoreConsts::elementNode) &&
+ (column_kind != store::StoreConsts::textNode))
+ continue;
+ if(column_kind == store::StoreConsts::elementNode)
+ {
+ if(headers.size() <= level)
+ headers.resize(level+1);
+ Item element_name;
+ column.getNodeName(element_name);
+ String column_name = element_name.getLocalName();
+ std::vector<String> &header = headers.at(level);
+ if(header.size() < position)
+ header.resize(position);
+ header.push_back(column_name);
+ unsigned int prev_position = position;
+ csv_get_headers(column, level+1, position);
+ if(prev_position == position)
+ position++;
+ }
+ else if(column_kind == store::StoreConsts::textNode)
+ {
+ String text_string = column.getStringValue();
+ zfn::trim( text_string );
+ if(!text_string.empty())
+ {
+ position++;
+ }
+ }
+ }
+ children->close();
+}
+
+void CSVSerializeFunction::StringStreamSequence::check_foreign_input(Iterator_t children)
+{
+ if(csv_options.ignore_foreign_input)
+ return;
+ Item store_column;
+ while(children->next(store_column))
+ {
+ int column_kind = store_column.getNodeKind();
+ if((column_kind != store::StoreConsts::elementNode) &&
+ (column_kind != store::StoreConsts::textNode))
+ continue;
+ if(column_kind == store::StoreConsts::textNode)
+ {
+ String text_string = store_column.getStringValue();
+ zfn::trim( text_string );
+ if(text_string.empty())
+ continue;
+ }
+
+ //else raise error: we have a foreign element in the <row> element
+ std::stringstream lSs;
+ String foreign_input;
+ if(column_kind == store::StoreConsts::textNode)
+ {
+ foreign_input = "text node ";
+ foreign_input += store_column.getStringValue();
+ }
+ else
+ {
+ Item element_name;
+ store_column.getNodeName(element_name);
+ foreign_input = "element node ";
+ foreign_input += element_name.getStringValue();
+ }
+ lSs << "The structure of the input rows does not correspond to the header. "
+ "Foreign item discovered:" << foreign_input;
+ Item lQName = CSVModule::getItemFactory()->createQName(CSVModule::theModule, "ForeignInput");
+ throw USER_EXCEPTION( lQName, lSs.str());
+ }
+}
+
+void CSVSerializeFunction::StringStreamSequence::csv_write_line(
+ Item node,
+ std::vector<String>& line,
+ unsigned int level)
+{
+ //iterate through all children of the node and get the string values
+ Iterator_t children = node.getChildren();
+ Item store_column;
+ bool has_children = false;
+
+ children->open();
+ while(children->next(store_column))
+ {
+ int column_kind = store_column.getNodeKind();
+ if((column_kind != store::StoreConsts::elementNode) &&
+ (column_kind != store::StoreConsts::textNode))
+ continue;
+ if(!headers.size())
+ {
+ if(column_kind != store::StoreConsts::elementNode)
+ continue;
+ line.push_back(store_column.getStringValue());
+ }
+ else
+ {
+ std::vector<String> &header = headers.at(level);
+ if(column_kind == store::StoreConsts::elementNode)
+ {
+ Item element_name;
+ store_column.getNodeName(element_name);
+ String column_name = element_name.getLocalName();
+ for(size_t i=line.size();i<header.size();i++)
+ {
+ if(header.at(i) == column_name)
+ {
+ has_children = true;
+ line.resize(i);
+ if(level == (headers.size()-1))
+ {
+ line.push_back(store_column.getStringValue());
+ }
+ else
+ {
+ csv_write_line(store_column, line, level+1);
+ }
+ if(line.size() >= header.size())
+ {
+ check_foreign_input(children);
+ return;
+ }
+ break;
+ }
+ else if((i+1)<header.size() && level)
+ {
+ unsigned int l;
+ for(l=0;l<level;l++)
+ if(!headers.at(l)[i+1].empty())
+ break;
+ if(l<level)
+ break;
+ }
+ if(!csv_options.ignore_foreign_input)
+ {
+ std::stringstream lSs;
+ String foreign_input;
+ Item element_name;
+ store_column.getNodeName(element_name);
+ foreign_input = "element node ";
+ foreign_input += element_name.getStringValue();
+ lSs << "The structure of the input rows does not correspond to the header. "
+ "Foreign item discovered:" << foreign_input;
+ Item lQName = CSVModule::getItemFactory()->createQName(CSVModule::theModule, "ForeignInput");
+ throw USER_EXCEPTION( lQName, lSs.str());
+ }
+ }
+ }
+ else if(column_kind == store::StoreConsts::textNode)
+ {
+ unsigned int l;
+ String text_string = store_column.getStringValue();
+ zfn::trim( text_string );
+ for(l=level;l<headers.size();l++)
+ if(!headers.at(l)[line.size()].empty())
+ break;
+ if(l<headers.size())
+ {
+ if(!csv_options.ignore_foreign_input)
+ {
+ if(!text_string.empty())
+ {
+ std::stringstream lSs;
+ String foreign_input;
+ foreign_input = "text node ";
+ foreign_input += text_string;
+ lSs << "The structure of the input rows does not correspond to the header. "
+ "Foreign item discovered:" << foreign_input;
+ Item lQName = CSVModule::getItemFactory()->createQName(CSVModule::theModule, "ForeignInput");
+ throw USER_EXCEPTION( lQName, lSs.str());
+ }
+ }
+ continue;//not a place for text
+ }
+ if(line.size() >= header.size())
+ {
+ if(!csv_options.ignore_foreign_input)
+ {
+ if(!text_string.empty())
+ {
+ std::stringstream lSs;
+ String foreign_input;
+ foreign_input = "text node ";
+ foreign_input += text_string;
+ lSs << "The structure of the input rows does not correspond to the header. "
+ "Foreign item discovered:" << foreign_input;
+ Item lQName = CSVModule::getItemFactory()->createQName(CSVModule::theModule, "ForeignInput");
+ throw USER_EXCEPTION( lQName, lSs.str());
+ }
+ }
+ return;
+ }
+ if(!text_string.empty())
+ {
+ has_children = true;
+ line.push_back(text_string);
+ }
+ }
+ }
+ }
+ children->close();
+ if(headers.size() && !has_children)
+ {//have to add something
+ line.push_back("");
+ }
+}
+
+
+bool CSVSerializeFunction::StringStreamSequence::needs_quote(String &field)
+{
+// if((field.indexOf(csv_options.separator.c_str()) >= 0) ||
+// (csv_options.quote_char_size && field.indexOf(csv_options.quote_char.c_str()) >= 0) ||
+// (field.indexOf("\n") >= 0) || (field.indexOf("\r") >= 0))
+// return true;
+// else
+// return false;
+ const char *field_str = field.c_str();
+ const char *separator_str = csv_options.separator.c_str();
+ const char *quote_char_str = csv_options.quote_char_size ? csv_options.quote_char.c_str() : "";
+
+ while(*field_str)
+ {
+ if((*field_str == '\n') || (*field_str == '\r'))
+ return true;
+ if((*field_str == *separator_str) && !strncmp(field_str, separator_str, csv_options.separator_size))
+ return true;
+ if((*field_str == *quote_char_str) && !strncmp(field_str, quote_char_str, csv_options.quote_char_size))
+ return true;
+ field_str++;
+ }
+ return false;
+}
+
+std::string CSVSerializeFunction::StringStreamSequence::csv_quote_field(
+ String &field)
+{
+ const char *fieldstr = field.c_str();
+ std::string result;
+ result.reserve(field.size() + 10);
+ result.append(csv_options.quote_char);
+ while(*fieldstr)
+ {
+ if(csv_options.quote_char_size && !strncmp(csv_options.quote_char.c_str(), fieldstr, csv_options.quote_char_size) )
+ {
+ result.append(csv_options.quote_escape);
+ fieldstr += csv_options.quote_char_size;
+ }
+ else
+ {
+ unsigned int seqlen = utf8_sequence_length(fieldstr);
+ result.append(fieldstr, seqlen);
+ fieldstr += seqlen;
+ }
+ }
+ result.append(csv_options.quote_char);
+ return result;
+}
+
+void CSVSerializeFunction::StringStreamSequence::csv_write_line_to_string(std::vector<String> &line,
+ std::string &result_string)
+{
+ std::vector<String>::iterator line_it;
+ size_t addlen = 1;
+ for(line_it = line.begin(); line_it != line.end(); line_it++)
+ {
+ addlen += line_it->size() + csv_options.separator_size;
+ }
+ result_string.reserve(result_string.length() + addlen);
+
+ for(line_it = line.begin(); line_it != line.end(); line_it++)
+ {
+ if(line_it != line.begin())
+ result_string.append(csv_options.separator);
+ if(needs_quote(*line_it))
+ {
+ result_string.append(csv_quote_field(*line_it));
+ }
+ else
+ result_string.append((*line_it).c_str());
+ }
+ result_string.append("\n");
+}
+
+
+void CSVSerializeFunction::StringStreamSequence::txt_write_line_to_string(std::vector<String> &line,
+ std::string &result_string)
+{
+ result_string.reserve(result_string.length() + csv_options.column_positions.back() + 1);
+
+ if(csv_options.column_positions[0] > 1)
+ result_string.append(csv_options.column_positions[0] - 1, ' ');
+
+ unsigned int i;
+ size_t column_positions_size = csv_options.column_positions.size();
+ for(i=0;i<column_positions_size;i++)
+ {
+ if(i >= line.size())
+ break;
+ unsigned int field_length = (unsigned int)line[i].length();
+ unsigned int column_length;
+ if(i < (column_positions_size-1))
+ {
+ column_length = csv_options.column_positions[i+1] - csv_options.column_positions[i];
+ if(field_length < column_length)
+ {
+ if(!csv_options.aligns[i])//align left
+ {
+ result_string.append(line[i].c_str());
+ result_string.append(column_length - field_length, ' ');
+ }
+ else//align right
+ {
+ result_string.append(column_length - field_length, ' ');
+ result_string.append(line[i].c_str());
+ }
+ }
+ else if(field_length == column_length)
+ {
+ result_string.append(line[i].c_str());
+ }
+ else
+ {
+ result_string.append(line[i].c_str(), column_length);
+ }
+ }
+ else if(!csv_options.last_column_position_is_computed)
+ {
+ result_string.append(line[i].c_str());
+ }
+ }
+ result_string.append("\n");
+}
+
+void CSVSerializeFunction::StringStreamSequence::open()
+{
+ is_open = true;
+// input_iter->open();
+ line_index = 1;
+ if(open_count)
+ {
+ is->seekg(0);
+ if(is->fail())
+ {
+ std::stringstream lSs;
+ lSs << "Cannot reset CSVSerialize streamable string item";
+ Item lQName = CSVModule::getItemFactory()->createQName(CSVModule::theModule, "CSV003");
+ throw USER_EXCEPTION( lQName, lSs.str());
+ }
+ }
+ open_count++;
+}
+
+void CSVSerializeFunction::StringStreamSequence::close()
+{
+// input_iter->close();
+ is_open = false;
+}
+
+bool CSVSerializeFunction::StringStreamSequence::isOpen() const
+{
+ return is_open;
+}
+
+bool CSVSerializeFunction::StringStreamSequence::next( Item &result )
+{
+ assert(is_open);
+
+ if(!has_next)
+ return false;
+ result = streamable_item;
+ has_next = false;
+ return true;
+}
+
+
+bool CSVSerializeFunction::StringStreamSequence::next(std::string &result_string)
+{
+ if(!input_iter->next(node_item))
+ return false;
+
+ if(csv_options.first_row_is_header > 0)
+ {
+ unsigned int position = 0;
+ csv_get_headers( node_item,
+ 0,
+ position);
+ for(unsigned int i=0;i<headers.size();i++)
+ {
+ headers.at(i).resize(position);
+
+ //now write the headers
+ if(csv_options.column_positions.size() == 0)
+ {
+ csv_write_line_to_string(headers.at(i),
+ result_string);
+ }
+ else
+ {
+ txt_write_line_to_string(headers.at(i),
+ result_string);
+ }
+ }
+ csv_options.first_row_is_header = 0;
+ }
+
+ while(1)
+ {
+ line.clear();
+ csv_write_line(node_item,
+ line, 0);
+ if(csv_options.column_positions.size() == 0)
+ break;//for csv don't ignore empty lines
+ unsigned int i;
+ for(i=0;i<line.size();i++)
+ {
+ if(!line.at(i).empty())
+ break;
+ }
+ if(i != line.size())
+ break;
+ if(!input_iter->next(node_item))
+ return false;
+ }
+
+ //std::string line_string;
+ if(csv_options.column_positions.size() == 0)
+ {
+ csv_write_line_to_string(line,
+ result_string);
+ }
+ else
+ {
+ txt_write_line_to_string(line,
+ result_string);
+ }
+ line_index++;
+ return true;
+}
+
+bool CSVSerializeFunction::StringStreamSequence::reset()
+{
+ input_iter->close();
+ input_iter->open();
+ return true;
+}
+
+zorba::ItemSequence_t
+CSVSerializeFunction::evaluate(const Arguments_t& args,
+ const zorba::StaticContext* sctx,
+ const zorba::DynamicContext* dctx) const
+{
+
+ Item options_item;
+ Iterator_t arg1_iter = args[1]->getIterator();
+ arg1_iter->open();
+ arg1_iter->next(options_item);
+ arg1_iter->close();
+
+ StringStreamSequence *stream_sequence = new StringStreamSequence((ItemSequence*)args[0]);
+ stream_sequence->csv_options.parse(options_item, theModule->getItemFactory());
+ stream_sequence->streamable_item =
+ theModule->getItemFactory()->createStreamableString(
+ *(stream_sequence->is), &StringStreamSequence::releaseStream, true /* seekable */);
+
+ return ItemSequence_t(stream_sequence);
+}
+
+
+}} /* namespace csv & zorba */
+
+
+#ifdef WIN32
+# define DLL_EXPORT __declspec(dllexport)
+#else
+# define DLL_EXPORT __attribute__ ((visibility("default")))
+#endif
+
+extern "C" DLL_EXPORT zorba::ExternalModule* createModule() {
+ return new zorba::csv::CSVModule();
+}
+/* vim:set et sw=2 ts=2: */
=== added file 'src/com/zorba-xquery/www/modules/converters/csv.xq.src/csv.h'
--- src/com/zorba-xquery/www/modules/converters/csv.xq.src/csv.h 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/csv.xq.src/csv.h 2011-12-06 07:32:41 +0000
@@ -0,0 +1,275 @@
+/*
+ * Copyright 2006-2008 The FLWOR 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.
+ */
+#ifndef ZORBA_PROCESSMODULE_CSV_H
+#define ZORBA_PROCESSMODULE_CSV_H
+
+#include <zorba/zorba.h>
+#include <zorba/iterator.h>
+#include <zorba/external_module.h>
+#include <zorba/function.h>
+#include <zorba/smart_ptr.h>
+
+#include "stream_wrapper.h"
+#include "stringiterator_streambuf.h"
+
+namespace zorba {
+namespace csv {
+
+/******************************************************************************
+ *****************************************************************************/
+class CSVModule : public ExternalModule
+{
+private:
+ static ItemFactory* theFactory;
+ ExternalFunction* lParseFunc;
+ ExternalFunction* lSerializeFunc;
+protected:
+ class ltstr
+ {
+ public:
+ bool operator()(const String& s1, const String& s2) const
+ {
+ return s1.compare(s2) < 0;
+ }
+ };
+
+public:
+ CSVModule();
+ virtual ~CSVModule() {delete lParseFunc; delete lSerializeFunc;}
+
+ static const char* theModule;
+
+ virtual zorba::String getURI() const
+ { return theModule; }
+
+ virtual zorba::ExternalFunction*
+ getExternalFunction(const zorba::String &aLocalname);
+
+ virtual void destroy();
+
+ static ItemFactory* getItemFactory()
+ {
+ if(!theFactory)
+ {
+ theFactory = Zorba::getInstance(0)->getItemFactory();
+ }
+
+ return theFactory;
+ }
+};
+
+/******************************************************************************
+ *****************************************************************************/
+
+class CSVOptions
+{
+public:
+ std::string separator;
+ unsigned int separator_size;
+ std::string quote_char;
+ unsigned int quote_char_size;
+ std::string quote_escape;
+ unsigned int quote_escape_size;
+
+ std::vector<unsigned int> column_positions;
+ std::vector<bool> aligns;
+ bool last_column_position_is_computed;
+
+ unsigned int first_row_is_header;
+ unsigned int last_subheader_row;
+ unsigned int start_from_row;//default 1
+ unsigned int last_row;//default 0
+ bool add_last_void_columns;
+ bool ignore_foreign_input;
+ bool accept_all_lines;
+ Item row_qname;
+ bool column_specified;
+ Item column_qname;
+
+public:
+ CSVOptions();
+
+ void parse(zorba::Item options_node, ItemFactory *item_factory);
+};
+
+
+class CSVParseFunction : public ContextualExternalFunction
+{
+ class CSVItemSequence : public ItemSequence, public Iterator
+ {
+ private:
+ ItemFactory *item_factory;
+ unsigned int line_index;
+ SmartPtr<CharStreamBase> input_stream;
+ bool is_open;
+ int open_count;
+
+ std::vector<std::pair<String, String> > ns_binding;
+ Item null_parent;
+ zorba::Item item_type;
+ std::vector<std::string> line;
+
+ class HeaderNode : public SmartObject
+ {
+ public:
+ zorba::Item name;
+ unsigned int level;
+ unsigned int start_pos;
+ SmartPtr<HeaderNode> parent;
+ std::vector<HeaderNode*> children;
+ };
+ std::vector<SmartPtr<HeaderNode> > header_qnames;
+ public:
+ CSVOptions csv_options;
+
+ public:
+ CSVItemSequence();
+ virtual ~CSVItemSequence() {}
+
+ void init(Item string_item, ItemFactory *item_factory);
+
+ Iterator_t getIterator() {return this;}
+
+ //Iterator interface
+ virtual void open();
+ virtual bool next(Item& aItem);
+ virtual void close();
+ virtual bool isOpen() const;
+ private:
+ void rtrim(std::string &field);
+
+ bool read_line(std::vector<std::string>& line);
+ bool csv_read_line(std::vector<std::string>& line);
+ bool txt_read_line(std::vector<std::string> &line);
+ void buildHeader(std::vector<std::vector<std::string> > &headers);
+ bool buildNodeTree(zorba::Item parent,
+ HeaderNode *current,
+ //std::vector<std::string> &line,
+ unsigned int &line_pos
+ //unsigned int indent_level,
+ //zorba::Item item_type,
+ //std::vector<std::pair<String, String> > &ns_binding
+ );
+
+ };
+public:
+ CSVParseFunction(const CSVModule* aModule) : theModule(aModule) {}
+
+ virtual ~CSVParseFunction() {};
+
+ virtual zorba::String
+ getLocalName() const { return "parse-internal"; }
+
+ virtual zorba::ItemSequence_t
+ evaluate(const Arguments_t&,
+ const zorba::StaticContext*,
+ const zorba::DynamicContext*) const;
+
+ virtual String getURI() const
+ {
+ return theModule->getURI();
+ }
+
+protected:
+ const CSVModule* theModule;
+};
+
+
+class CSVSerializeFunction : public ContextualExternalFunction
+{
+ class StringStreamSequence : public ItemSequence, public Iterator, public StringIteratorStreamBuf
+ {
+ private:
+ //ItemSequence* input_nodes;
+ Iterator_t input_iter;
+ std::vector<std::vector<String> > headers;
+ int line_index;
+ bool has_next;
+ bool is_open;
+ int open_count;
+
+ std::vector<String> line;
+ Item node_item;
+ public:
+ std::istream* is;
+ CSVOptions csv_options;
+ Item streamable_item;
+ public:
+ StringStreamSequence(ItemSequence* input);
+ virtual ~StringStreamSequence() {}
+
+ //for Iterator
+ virtual void open();
+ virtual void close();
+ virtual bool isOpen() const;
+ virtual bool next( Item &result );
+
+ //for ItemSequence
+ Iterator_t getIterator() {return this;}
+
+ //for StringIteratorStreamBuf
+ virtual bool next(std::string &next_string);
+ virtual bool reset();
+
+ static void
+ releaseStream(std::istream* stream) { delete stream; }
+
+ private:
+ void csv_get_headers( Item node,
+ unsigned int level,
+ unsigned int &position);
+ void csv_write_line(
+ Item node,
+ std::vector<String>& line,
+ unsigned int level);
+ bool needs_quote(String &field);
+ std::string csv_quote_field(String &field);
+ void csv_write_line_to_string(std::vector<String> &line,
+ std::string &result_string);
+ void txt_write_line_to_string(std::vector<String> &line,
+ std::string &result_string);
+ void check_foreign_input(Iterator_t children);
+ };
+public:
+ CSVSerializeFunction(const CSVModule* aModule) : theModule(aModule) {}
+
+ virtual ~CSVSerializeFunction() {}
+
+ virtual zorba::String
+ getLocalName() const { return "serialize-internal"; }
+
+ virtual zorba::ItemSequence_t
+ evaluate(const Arguments_t&,
+ const zorba::StaticContext*,
+ const zorba::DynamicContext*) const;
+
+ virtual String getURI() const
+ {
+ return theModule->getURI();
+ }
+
+private:
+
+protected:
+ const CSVModule* theModule;
+};
+
+
+
+} /* namespace csv */
+} /* namespace zorba */
+
+#endif // ZORBA_PROCESSMODULE_CSV_H
=== added file 'src/com/zorba-xquery/www/modules/converters/csv.xq.src/stream_wrapper.cpp'
--- src/com/zorba-xquery/www/modules/converters/csv.xq.src/stream_wrapper.cpp 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/csv.xq.src/stream_wrapper.cpp 2011-12-06 07:32:41 +0000
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2006-2011 The FLWOR 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.
+ */
+#include <string.h>
+#include "stream_wrapper.h"
+namespace zorba {
+unsigned int utf8_sequence_length(const char* lead_it);
+namespace csv {
+
+StreamWrapper::StreamWrapper(Item string_item, unsigned int temp_buf_size)
+ : theStringItem(string_item)
+{
+ //this->string_item = string_item;
+ csv_is = &string_item.getStream();
+ if(temp_buf_size < 4096)
+ temp_buf_size = 4096;
+ this->temp_buf_size = temp_buf_size;
+
+ tempstr = new char[temp_buf_size + 10];
+ start_str = tempstr;
+ end_str = start_str;
+ utf8_len = 0;
+}
+
+StreamWrapper::~StreamWrapper()
+{
+ delete[] tempstr;
+}
+
+void StreamWrapper::read_buf()
+{
+ if(start_str != end_str)
+ {
+ memmove(tempstr, start_str, (end_str-start_str));
+ }
+ end_str = tempstr + (end_str-start_str);
+ start_str = tempstr;
+ std::streambuf *csv_buf = csv_is->rdbuf();
+ std::streamsize readlen = csv_buf->sgetn(end_str, temp_buf_size - (end_str-start_str));
+ if (readlen != (temp_buf_size - (end_str-start_str)))
+ csv_is->setstate(std::ios_base::eofbit | std::ios_base::failbit); // short read
+ end_str += readlen;
+
+}
+
+bool StreamWrapper::is_end()
+{
+ return csv_is->eof() && (start_str == end_str);
+}
+
+unsigned int StreamWrapper::get_utf8_sequence_length()
+{
+ if(start_str == end_str)
+ {
+ read_buf();
+ }
+ utf8_len = utf8_sequence_length(start_str);
+ return utf8_len;
+}
+
+const char *StreamWrapper::get_utf8_seq()
+{
+ if(!utf8_len)
+ utf8_len = get_utf8_sequence_length();
+ if((start_str+utf8_len) > end_str)
+ {
+ read_buf();
+ }
+ return start_str;
+}
+
+bool StreamWrapper::compare(std::string &other)
+{
+ int other_length = (int)other.length();
+ if((end_str-start_str) < other_length)
+ {
+ read_buf();
+ }
+ if((end_str-start_str) < other_length)
+ {
+ return false;
+ }
+ if(other_length == 1)
+ {
+ return (start_str[0] == other.c_str()[0]);
+ }
+ if(!strncmp(other.c_str(), start_str, other_length))
+ return true;
+ else
+ return false;
+}
+
+void StreamWrapper::skip(unsigned int nr_chars)
+{
+ utf8_len = 0;
+ if((int)nr_chars > (end_str-start_str))
+ {
+ nr_chars -= (end_str-start_str);
+ start_str = end_str;
+ read_buf();
+ }
+ if((int)nr_chars >= (end_str-start_str))
+ {
+ end_str = tempstr;
+ start_str = tempstr;
+ }
+ else
+ {
+ start_str += nr_chars;
+ }
+}
+
+bool StreamWrapper::reset()
+{
+ std::streamoff pos = csv_is->tellg();
+ if(pos == 0)
+ return true;
+ csv_is->seekg(0);
+ if(csv_is->fail())
+ {
+ csv_is->clear();
+ return false;
+ }
+ start_str = tempstr;
+ end_str = start_str;
+ utf8_len = 0;
+ return true;
+}
+
+
+
+
+/////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////
+CharPtrStream::CharPtrStream(Item string_item)
+{
+ this->string_item = string_item;
+ csv_string = string_item.getStringValue();
+ str = csv_string.c_str();
+}
+
+CharPtrStream::~CharPtrStream()
+{
+}
+
+bool CharPtrStream::is_end()
+{
+ return !*str;
+}
+
+unsigned int CharPtrStream::get_utf8_sequence_length()
+{
+ return utf8_sequence_length(str);
+}
+
+const char *CharPtrStream::get_utf8_seq()
+{
+ return str;
+}
+
+bool CharPtrStream::compare(std::string &other)
+{
+ return !strncmp(other.c_str(), str, other.length());
+}
+
+void CharPtrStream::skip(unsigned int nr_chars)
+{
+ str += nr_chars;
+}
+
+bool CharPtrStream::reset()
+{
+ str = csv_string.c_str();
+ return true;
+}
+
+
+}}//end namespace csv/zorba
\ No newline at end of file
=== added file 'src/com/zorba-xquery/www/modules/converters/csv.xq.src/stream_wrapper.h'
--- src/com/zorba-xquery/www/modules/converters/csv.xq.src/stream_wrapper.h 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/csv.xq.src/stream_wrapper.h 2011-12-06 07:32:41 +0000
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2006-2011 The FLWOR 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.
+ */
+#ifndef ZORBA_PROCESSMODULE_PROCESS_H
+#define ZORBA_PROCESSMODULE_PROCESS_H
+
+#include <zorba/zorba.h>
+#include <zorba/smart_ptr.h>
+
+namespace zorba {
+namespace csv {
+
+class CharStreamBase : public SmartObject
+{
+public:
+ virtual ~CharStreamBase() {}
+
+ virtual bool is_end() = 0;
+
+ virtual unsigned int get_utf8_sequence_length() = 0;
+ virtual const char *get_utf8_seq() = 0;
+ virtual bool compare(std::string &other) = 0;
+ virtual void skip(unsigned int nr_chars) = 0;
+
+ virtual bool reset() = 0;
+};
+
+class StreamWrapper : public CharStreamBase
+{
+public:
+ std::istream *csv_is;
+ char *tempstr;
+ char *start_str;
+ char *end_str;
+ unsigned int temp_buf_size;
+ unsigned int utf8_len;
+ Item theStringItem; // need to keep this item to make sure it lives as long as the StreamWrapper Does
+
+ StreamWrapper(Item string_item, unsigned int temp_buf_size);
+ virtual ~StreamWrapper();
+
+ virtual bool is_end();
+
+ virtual unsigned int get_utf8_sequence_length();
+ virtual const char *get_utf8_seq();
+ virtual bool compare(std::string &other);
+ virtual void skip(unsigned int nr_chars);
+
+ virtual bool reset();
+private:
+ void read_buf();
+};
+
+class CharPtrStream : public CharStreamBase
+{
+public:
+ Item string_item;
+ zorba::String csv_string;
+ const char *str;
+
+ CharPtrStream(Item string_item);
+ virtual ~CharPtrStream();
+
+ virtual bool is_end();
+
+ virtual unsigned int get_utf8_sequence_length();
+ virtual const char *get_utf8_seq();
+ virtual bool compare(std::string &other);
+ virtual void skip(unsigned int nr_chars);
+
+ virtual bool reset();
+};
+
+}}
+
+#endif
\ No newline at end of file
=== added file 'src/com/zorba-xquery/www/modules/converters/csv.xq.src/stringiterator_streambuf.cpp'
--- src/com/zorba-xquery/www/modules/converters/csv.xq.src/stringiterator_streambuf.cpp 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/csv.xq.src/stringiterator_streambuf.cpp 2011-12-06 07:32:41 +0000
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2006-2008 The FLWOR 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.
+ */
+
+#include "stringiterator_streambuf.h"
+
+using namespace std;
+namespace zorba{
+
+StringIteratorStreamBuf::StringIteratorStreamBuf()
+{
+ current_buffer = 0;
+ last_buffer = 0;
+ begin_offset = 0;
+ is_eof = false;
+}
+
+//get next buffer
+int StringIteratorStreamBuf::underflow()
+{
+ if(is_eof)
+ return EOF;
+ begin_offset += buffer[current_buffer].length();
+ current_buffer = 1 - current_buffer;
+ if(last_buffer != current_buffer)
+ {
+ buffer[current_buffer].resize(0);
+ last_buffer = current_buffer;
+ if(!next(buffer[current_buffer]))
+ {
+ //current_buffer = 1 - current_buffer;
+ buffer[current_buffer].resize(0);
+ is_eof = true;
+ return EOF;
+ }
+ }
+ char *buffstr = (char*)buffer[current_buffer].c_str();
+ setg(buffstr, buffstr, buffstr+buffer[current_buffer].length());
+ return *buffstr;
+}
+
+//unget char, some special cases
+int StringIteratorStreamBuf::pbackfail ( int c )
+{
+ if(eback() != gptr())
+ {
+ setg(eback(), gptr()-1, egptr());
+ if(c != EOF)
+ *gptr() = (char)c;
+ return 1;
+ }
+
+ //else have to rewind to previous buffer
+ if(last_buffer != current_buffer)
+ return EOF;
+ if(buffer[1-last_buffer].length() == 0)
+ return EOF;
+ current_buffer = 1 - current_buffer;
+
+ begin_offset -= buffer[current_buffer].length();
+ char *buffstr = (char*)buffer[current_buffer].c_str();
+ setg(buffstr, buffstr+buffer[current_buffer].length()-1, buffstr+buffer[current_buffer].length());
+ if(c != EOF)
+ *gptr() = (char)c;
+ return 1;
+}
+
+//set a new position
+//if going too much back, restart the iterator
+streampos StringIteratorStreamBuf::seekoff ( streamoff off, ios_base::seekdir way, ios_base::openmode which )
+{
+ if(!(which & ios_base::in))
+ return -1;
+
+ streampos targetpos;
+ if(way == ios_base::end)
+ {
+ if(off > 0)
+ return -1;
+ while(underflow() != EOF);
+ streampos maxpos = begin_offset + (streamoff)buffer[current_buffer].length();
+ targetpos = maxpos + off;
+ }
+ else if(way == ios_base::cur)
+ {
+ targetpos = begin_offset + (streamoff)(gptr() - eback()) + off;
+ }
+ else if(way == ios_base::beg)
+ {
+ if(off < 0)
+ return -1;
+ targetpos = off;
+ }
+ else
+ return -1;
+ return seekpos(targetpos, ios_base::in);
+}
+
+//set a new position
+//if going too much back, restart the iterator
+streampos StringIteratorStreamBuf::seekpos ( streampos sp, ios_base::openmode which )
+{
+ if(!(which & ios_base::in))
+ return -1;
+
+ if(sp < begin_offset)
+ {
+ setg(eback(), eback(), egptr());
+ pbackfail(EOF);
+ if(sp < begin_offset)
+ {
+ //restart the iterator
+ if(!reset())
+ return -1;
+ buffer[0].resize(0);
+ buffer[1].resize(0);
+ current_buffer = last_buffer = 0;
+ begin_offset = 0;
+ is_eof = false;
+ setg(NULL, NULL, NULL);
+ }
+ }
+ while(sp >= (begin_offset+(streamoff)buffer[current_buffer].length()))
+ {
+ if(underflow() == EOF)
+ {
+ if(sp == (begin_offset+(streamoff)buffer[current_buffer].length()))
+ break;
+ return -1;
+ }
+ }
+
+ setg(eback(), eback() + (streamoff)(sp - begin_offset), egptr());
+ return sp;
+}
+
+}
\ No newline at end of file
=== added file 'src/com/zorba-xquery/www/modules/converters/csv.xq.src/stringiterator_streambuf.h'
--- src/com/zorba-xquery/www/modules/converters/csv.xq.src/stringiterator_streambuf.h 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/csv.xq.src/stringiterator_streambuf.h 2011-12-06 07:32:41 +0000
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2006-2008 The FLWOR 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.
+ */
+
+#include <stdio.h>
+#include <streambuf>
+
+#ifndef STRING_ITERATOR_TO_STREAMBUF_IMPL
+#define STRING_ITERATOR_TO_STREAMBUF_IMPL
+
+namespace zorba{
+
+class StringIteratorStreamBuf : public std::streambuf
+{
+ std::string buffer[2];
+ int current_buffer;
+ int last_buffer;
+ std::streampos begin_offset;
+ bool is_eof;
+public:
+ StringIteratorStreamBuf();
+ virtual ~StringIteratorStreamBuf() {}
+
+ virtual int underflow ( );
+ virtual int pbackfail ( int c = EOF );
+ //virtual int showmanyc ( );
+ //virtual streamsize xsgetn ( char * s, streamsize n );
+
+ virtual std::streampos seekoff ( std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out );
+ virtual std::streampos seekpos ( std::streampos sp, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out );
+
+public:
+ virtual bool next(std::string &next_string) = 0;
+ virtual bool reset() = 0;
+};
+
+}
+#endif
=== added file 'src/com/zorba-xquery/www/modules/converters/html-options.xsd'
--- src/com/zorba-xquery/www/modules/converters/html-options.xsd 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/html-options.xsd 2011-12-06 07:32:41 +0000
@@ -0,0 +1,40 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:ho="http://www.zorba-xquery.com/modules/converters/html-options"
+ targetNamespace="http://www.zorba-xquery.com/modules/converters/html-options"
+ elementFormDefault="qualified" attributeFormDefault="unqualified"
+ >
+<!--
+:: Copyright 2006-2008 The FLWOR 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.
+::
+-->
+
+
+ <xs:element name="options">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="tidyParam" minOccurs="0" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="value" type="xs:string" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
\ No newline at end of file
=== added file 'src/com/zorba-xquery/www/modules/converters/html.xq'
--- src/com/zorba-xquery/www/modules/converters/html.xq 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/html.xq 2011-12-06 07:32:41 +0000
@@ -0,0 +1,130 @@
+xquery version "3.0";
+
+(:
+ : Copyright 2006-2009 The FLWOR 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.
+:)
+
+(:~
+ : <p>
+ : This module provides functions to <a href="http://www.w3.org/People/Raggett/tidy/" target="_blank">tidy</a> a HTML document. <br />
+ : The functions in this module take an HTML document (a string) as parameter,
+ : tidy it in order to result in valid XHTML, and return this XHTML document as a document-node.
+ : </p>
+ :
+ :
+ : @author Sorin Nasoi
+ : @library <a href="http://tidy.sourceforge.net/">Tidy C++ Library</a>
+ : @project data processing/data converters
+ :
+ :)
+module namespace html = "http://www.zorba-xquery.com/modules/converters/html";
+
+(:~
+ : Import module for checking if html options element is validated.
+ :)
+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
+
+import schema namespace html-options = "http://www.zorba-xquery.com/modules/converters/html-options";
+
+declare namespace err = "http://ww.w3.org/2005/xqt-errors";
+
+declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
+declare option ver:module-version "1.0";
+
+(:~
+ : <p>This function tidies the given HTML string and returns
+ : a valid XHTML document node.</p>
+ :
+ : <p>This functions automatically sets the following tidying parameters:
+ : <ul>
+ : <li>output-xml=yes</li>
+ : <li>doctype=omit</li>
+ : <li>quote-nbsp=no</li>
+ : <li>char-encoding=utf8</li>
+ : <li>newline=LF</li>
+ : <li>tidy-mark=no</li>
+ : </ul>
+ : </p>
+ :
+ : @param $html the HTML string to tidy
+ : @return the tidied XML document
+ :
+ : @error html:InternalError if an internal error occurred while tidying
+ : the string.
+ :
+ : @example test_html/Queries/converters/html/tidy_2.xq
+ :)
+declare function html:parse (
+ $html as xs:string
+) as document-node()
+{
+ let $validated-options :=
+ validate {
+ <options xmlns="http://www.zorba-xquery.com/modules/converters/html-options" >
+ <tidyParam name="output-xml" value="yes" />
+ <tidyParam name="doctype" value="omit" />
+ <tidyParam name="quote-nbsp" value="no" />
+ <tidyParam name="char-encoding" value="utf8" />
+ <tidyParam name="newline" value="LF" />
+ <tidyParam name="tidy-mark" value="no" />
+ </options>
+ }
+ return
+ html:parse-internal($html, $validated-options)
+};
+
+(:~
+ : <p>This function tidies the given HTML string and returns
+ : a valid XHTML document node.</p>
+ :
+ : <p>The second parameter allows to specify options that
+ : configure the tidy process. This parameter is a sequence
+ : of name=value pairs. Allowed parameter names and values
+ : are documented at <a href="http://tidy.sourceforge.net/docs/quickref.html">
+ : http://tidy.sourceforge.net/docs/quickref.html</a>.</p>
+ :
+ : @param $html the HTML string to tidy
+ : @param $options a set of name and value pairs that provide options
+ : to configure the tidy process that have to be validated against the
+ : "http://www.zorba-xquery.com/modules/converters/html-options" schema.
+ : @return the tidied XHTML document node
+ :
+ : @error err:XQDY0027 if $options can not be validated against the
+ : html-options schema
+ : @error html:TidyOption if there was an error with one of the options
+ : in the $options parameter that couldn't have been caught by validating
+ : against the schema
+ : @error html:InternalError if an internal error occurred while tidying
+ : the string.
+ :
+ : @example test_html/Queries/converters/html/tidy_1.xq
+ :)
+declare function html:parse (
+ $html as xs:string,
+ $options as element(html-options:options)
+) as document-node()
+{
+ let $validated-options := if(schema:is-validated($options)) then
+ $options
+ else
+ validate { $options }
+ return
+ html:parse-internal($html, $validated-options)
+};
+
+declare %private function html:parse-internal(
+ $html as xs:string,
+ $options as element(html-options:options)
+) as document-node() external;
=== added directory 'src/com/zorba-xquery/www/modules/converters/html.xq.src'
=== added file 'src/com/zorba-xquery/www/modules/converters/html.xq.src/html.cpp'
--- src/com/zorba-xquery/www/modules/converters/html.xq.src/html.cpp 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/html.xq.src/html.cpp 2011-12-06 07:32:41 +0000
@@ -0,0 +1,145 @@
+/*
+ * Copyright 2006-2008 The FLWOR 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.
+ */
+
+#include <sstream>
+
+#include <zorba/empty_sequence.h>
+#include <zorba/singleton_item_sequence.h>
+#include <zorba/item.h>
+
+#include "html.h"
+#include "tidy_wrapper.h"
+
+namespace zorba
+{
+ namespace htmlmodule
+ {
+
+//*****************************************************************************
+//*****************************************************************************
+
+ParseFunction::ParseFunction(const HtmlModule* aModule)
+: HtmlFunction(aModule)
+{
+}
+
+ItemSequence_t
+ParseFunction::evaluate(
+ const ExternalFunction::Arguments_t& aArgs,
+ const StaticContext* aSctxCtx,
+ const DynamicContext* aDynCtx) const
+ {
+ std::auto_ptr<std::istringstream> iss;
+ std::istream *is;
+ String docString;
+ Item lStringItem, lOptionsItem;
+
+ if (aArgs.size() >= 1)
+ {
+ Iterator_t lArg0Iter = aArgs[0]->getIterator();
+ lArg0Iter->open();
+ lArg0Iter->next(lStringItem);
+ lArg0Iter->close();
+ }
+
+ if ( lStringItem.isStreamable() )
+ {
+ //
+ // The "iss" auto_ptr can NOT be used since it will delete the stream that,
+ // in this case, is a data member inside another object and not dynamically
+ // allocated.
+ //
+ // We can't replace "iss" with "is" since we still need the auto_ptr for
+ // the case when the result is not streamable.
+ //
+ is = &lStringItem.getStream();
+ }
+ else
+ {
+ docString = lStringItem.getStringValue();
+ iss.reset (new std::istringstream(docString.c_str()));
+ is = iss.get();
+ }
+
+ if (aArgs.size() == 2)
+ {
+ Iterator_t lArg1Iter = aArgs[1]->getIterator();
+ lArg1Iter->open();
+ lArg1Iter->next(lOptionsItem);
+ lArg1Iter->close();
+ }
+
+ return ItemSequence_t(new SingletonItemSequence(
+ createHtmlItem( *is , lOptionsItem )));
+ }
+
+//*****************************************************************************
+//*****************************************************************************
+
+ItemFactory* HtmlModule::theFactory = 0;
+
+HtmlModule::~HtmlModule()
+{
+ for ( FuncMap_t::const_iterator lIter = theFunctions.begin();
+ lIter != theFunctions.end();
+ ++lIter)
+ {
+ delete lIter->second;
+ }
+ theFunctions.clear();
+}
+
+ExternalFunction*
+HtmlModule::getExternalFunction(const String& aLocalname)
+{
+ ExternalFunction*& lFunc = theFunctions[aLocalname];
+ if (!lFunc)
+ {
+ if (1 == 0)
+ { }
+ else if (aLocalname == "parse-internal")
+ {
+ lFunc = new ParseFunction(this);
+ }
+ }
+ return lFunc;
+}
+
+void
+HtmlModule::destroy()
+{
+ if (!dynamic_cast<HtmlModule*>(this))
+ {
+ return;
+ }
+ delete this;
+}
+//*****************************************************************************
+//*****************************************************************************
+
+ } /* namespace htmlmodule */
+} /* namespace zorba */
+
+#ifdef WIN32
+# define DLL_EXPORT __declspec(dllexport)
+#else
+# define DLL_EXPORT __attribute__ ((visibility("default")))
+#endif
+
+extern "C" DLL_EXPORT zorba::ExternalModule* createModule()
+{
+ return new zorba::htmlmodule::HtmlModule();
+}
=== added file 'src/com/zorba-xquery/www/modules/converters/html.xq.src/html.h'
--- src/com/zorba-xquery/www/modules/converters/html.xq.src/html.h 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/html.xq.src/html.h 2011-12-06 07:32:41 +0000
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2006-2008 The FLWOR 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.
+ */
+#ifndef ZORBA_HTMLMODULE_HTML_H
+#define ZORBA_HTMLMODULE_HTML_H
+
+#include <map>
+
+#include <zorba/zorba.h>
+#include <zorba/function.h>
+#include <zorba/external_module.h>
+
+namespace zorba
+{
+ namespace htmlmodule
+ {
+//*****************************************************************************
+//*****************************************************************************
+ class HtmlModule : public ExternalModule
+ {
+ private:
+ static ItemFactory* theFactory;
+
+ protected:
+ class ltstr
+ {
+ public:
+ bool operator()(const String& s1, const String& s2) const
+ {
+ return s1.compare(s2) < 0;
+ }
+ };
+
+ typedef std::map<String, ExternalFunction*, ltstr> FuncMap_t;
+
+ FuncMap_t theFunctions;
+
+ public:
+ virtual ~HtmlModule();
+
+ virtual String
+ getURI() const { return "http://www.zorba-xquery.com/modules/converters/html"; }
+
+ virtual ExternalFunction*
+ getExternalFunction(const String& aLocalname);
+
+ virtual void
+ destroy();
+
+ static ItemFactory*
+ getItemFactory()
+ {
+ if(!theFactory)
+ {
+ theFactory = Zorba::getInstance(0)->getItemFactory();
+ }
+ return theFactory;
+ }
+ };
+
+//*****************************************************************************
+//*****************************************************************************
+ class HtmlFunction : public ContextualExternalFunction
+ {
+ protected:
+ const HtmlModule* theModule;
+ public:
+ HtmlFunction(const HtmlModule* aModule)
+ : theModule(aModule) {};
+
+ ~HtmlFunction() {};
+
+ virtual String
+ getURI() const { return theModule->getURI(); }
+
+ };
+
+//*****************************************************************************
+//*****************************************************************************
+ class ParseFunction : public HtmlFunction
+ {
+ public:
+ ParseFunction(const HtmlModule* aModule);
+
+ virtual String
+ getLocalName() const { return "parse-internal"; }
+
+ virtual ItemSequence_t
+ evaluate(const ExternalFunction::Arguments_t& args,
+ const StaticContext* aSctxCtx,
+ const DynamicContext* aDynCtx) const;
+ };
+
+
+
+
+ } /* namespace htmlmodule */
+} /* namespace zorba */
+
+#endif /* ZORBA_HTMLMODULE_HTML_H */
=== added file 'src/com/zorba-xquery/www/modules/converters/html.xq.src/tidy_wrapper.cpp'
--- src/com/zorba-xquery/www/modules/converters/html.xq.src/tidy_wrapper.cpp 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/html.xq.src/tidy_wrapper.cpp 2011-12-06 07:32:41 +0000
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2006-2008 The FLWOR 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.
+ */
+
+#include <iostream>
+
+#include <tidy.h>
+#include <buffio.h>
+
+#include "tidy_wrapper.h"
+
+#include <zorba/item_factory.h>
+#include <zorba/item.h>
+#include <zorba/xmldatamanager.h>
+
+namespace zorba
+{
+ namespace htmlmodule
+ {
+
+ } /* namespace htmlmodule */
+} /* namespace zorba */
\ No newline at end of file
=== added file 'src/com/zorba-xquery/www/modules/converters/html.xq.src/tidy_wrapper.h'
--- src/com/zorba-xquery/www/modules/converters/html.xq.src/tidy_wrapper.h 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/html.xq.src/tidy_wrapper.h 2011-12-06 07:32:41 +0000
@@ -0,0 +1,200 @@
+/*
+ * Copyright 2006-2008 The FLWOR 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.
+ */
+
+#ifndef ZORBA_HTMLMODULE_TIDY_WRAPPER_H
+#define ZORBA_HTMLMODULE_TIDY_WRAPPER_H
+
+#include <iostream>
+#include <sstream>
+
+#include <tidy.h>
+#include <buffio.h>
+
+#include <zorba/item_factory.h>
+#include <zorba/item.h>
+#include <zorba/iterator.h>
+#include <zorba/store_consts.h>
+#include <zorba/xmldatamanager.h>
+#include <zorba/error.h>
+#include <zorba/diagnostic_list.h>
+#include <zorba/user_exception.h>
+#include <zorba/zorba.h>
+
+namespace zorba
+{
+ namespace htmlmodule
+ {
+ class TidyReader {
+ private:
+ std::istream* theStream;
+ // We need a buffer to support the unget function
+ std::vector<unsigned int> theBuffer;
+ public:
+ TidyReader(std::istream* aStream) : theStream(aStream) {}
+ TidyInputSource getInputSource()
+ {
+ TidyInputSource lResult;
+ lResult.sourceData = this;
+ lResult.getByte = &getByte;
+ lResult.ungetByte = &ungetByte;
+ lResult.eof = &isEof;
+ return lResult;
+ }
+
+ public: // callback functions
+ static int TIDY_CALL getByte(void* aData)
+ {
+ TidyReader* lReader = static_cast<TidyReader*>(aData);
+ if (lReader->theBuffer.empty())
+ return lReader->theStream->get();
+ else
+ {
+ int lResult = lReader->theBuffer.back();
+ lReader->theBuffer.pop_back();
+ return lResult;
+ }
+ }
+
+ static void TIDY_CALL ungetByte(void* aData, byte aByte)
+ {
+ TidyReader* lReader = static_cast<TidyReader*>(aData);
+ lReader->theBuffer.push_back(aByte);
+ }
+
+ static Bool TIDY_CALL isEof(void* aData)
+ {
+ TidyReader* lReader = static_cast<TidyReader*>(aData);
+ return lReader->theStream->eof() ? yes : no;
+ }
+ };
+
+ static void checkRC(int rc, const char* errMsg)
+ {
+ if (rc > 1)
+ {
+ zorba::Item lError = Zorba::getInstance(0)->getItemFactory()
+ ->createQName(
+ "http://www.zorba-xquery.com/modules/converters/html",
+ "InternalError");
+ throw USER_EXCEPTION(lError, errMsg );
+ }
+ }
+
+ static Bool setTidyOption(TidyDoc doc, const char* option, const char* value)
+ {
+ Bool ok = yes;
+ TidyOptionId toID = tidyOptGetIdForName(option);
+ if(toID < N_TIDY_OPTIONS)
+ {
+ ok = tidyOptSetValue(doc, toID, value);
+ if (ok != yes)
+ {
+ zorba::Item lError = Zorba::getInstance(0)->getItemFactory()
+ ->createQName(
+ "http://www.zorba-xquery.com/modules/converters/html",
+ "TidyOption");
+ std::ostringstream lErrorMsg;
+ lErrorMsg << "Error setting tidy option '" << option
+ << "' with value '" << value << "'";
+ throw USER_EXCEPTION(lError, lErrorMsg.str());
+ }
+ }
+ else
+ {
+ return no;
+ }
+ return ok;
+ }
+
+ static Bool applyOptions(TidyDoc aDoc, zorba::Item &aOptions)
+ {
+ zorba::Iterator_t lAttributes, lElements;
+ zorba::Item lAttr, lElementItem, lAttrName;
+ zorba::String lStrName, lStrValue;
+ Bool lRet = yes;
+
+ if(!aOptions.isNull())
+ {
+ lElements = aOptions.getChildren();
+ lElements->open();
+ while (lElements->next(lElementItem)
+ && lElementItem.getNodeKind () == store::StoreConsts::elementNode)
+ {
+ lAttributes = lElementItem.getAttributes();
+ lAttributes->open();
+ while (lAttributes->next(lAttr))
+ {
+ lAttr.getNodeName(lAttrName);
+ if(lAttrName.getLocalName() == "name")
+ lStrName = lAttr.getStringValue();
+ else if(lAttrName.getLocalName() == "value")
+ lStrValue = lAttr.getStringValue();
+ }
+ setTidyOption(aDoc, lStrName.c_str(), lStrValue.c_str());
+ lAttributes->close();
+ }
+ lElements->close();
+ }
+ return lRet;
+ }
+
+ static zorba::Item createHtmlItem( std::istream& aStream , zorba::Item &aOptions)
+ {
+ TidyReader lReader(&aStream);
+ TidyInputSource lInputSource = lReader.getInputSource();
+
+ TidyBuffer output;
+ tidyBufInit(&output);
+ TidyBuffer errbuf;
+ tidyBufInit(&errbuf);
+ TidyDoc tDoc = tidyCreate();
+
+ applyOptions(tDoc, aOptions);
+
+ int rc = -1;
+ rc = tidySetErrorBuffer(tDoc, &errbuf);
+ checkRC(rc, "Could not set error buffer");
+ rc = tidyParseSource(tDoc, &lInputSource);
+ checkRC(rc, "Could not parse the source");
+ rc = tidyCleanAndRepair(tDoc);
+ checkRC(rc, "Could not clean and repair");
+ rc = tidyRunDiagnostics(tDoc);
+ if ( rc > 1 )
+ rc = ( tidyOptSetBool(tDoc, TidyForceOutput, yes) ? rc : -1 );
+
+ // Tidy does not support streaming for output, it only supports
+ // something they call a "sink". Therefore we buffer it in a string.
+ rc = tidySaveBuffer(tDoc, &output);
+ checkRC(rc, "Could not save the buffer");
+ std::string lResult((char*) output.bp, output.size);
+ std::istringstream lStream(lResult);
+
+ tidyBufFree(&output);
+ tidyBufFree(&errbuf);
+ tidyRelease(tDoc);
+ XmlDataManager* lDM = Zorba::getInstance(0)->getXmlDataManager();
+ try
+ {
+ return lDM->parseXML(lStream);
+ } catch (ZorbaException&)
+ {
+ return NULL;//Zorba::getInstance(0)->getItemFactory()->createString(lResult);
+ }
+ }
+ } /* namespace htmlmodule */
+} /* namespace zorba */
+
+#endif //ZORBA_HTMLMODULE_TIDY_WRAPPER_H
=== added file 'src/com/zorba-xquery/www/modules/converters/json-options.xsd'
--- src/com/zorba-xquery/www/modules/converters/json-options.xsd 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/json-options.xsd 2011-12-06 07:32:41 +0000
@@ -0,0 +1,47 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:json="http://www.zorba-xquery.com/modules/converters/json-options"
+ targetNamespace="http://www.zorba-xquery.com/modules/converters/json-options"
+ elementFormDefault="qualified" attributeFormDefault="unqualified">
+<!--
+:: Copyright 2006-2008 The FLWOR 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.
+::
+-->
+
+
+ <xs:element name="options">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="json-param" minOccurs="1" maxOccurs="1">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="value" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="simple-json"/>
+ <xs:enumeration value="json-ml"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="type" type="xs:string" use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
=== added file 'src/com/zorba-xquery/www/modules/converters/json.xq'
--- src/com/zorba-xquery/www/modules/converters/json.xq 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/json.xq 2011-12-06 07:32:41 +0000
@@ -0,0 +1,242 @@
+xquery version "3.0";
+
+ (:
+ : Copyright 2006-2009 The FLWOR 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.
+ :)
+
+ (:~
+ :
+ : <p>In order to enable JSON processing with XQuery, Zorba implements a set
+ : of functions that open XQuery developers the door to process JSON
+ : data. Specifically, this module provides two types of functions. Functions
+ : to:
+ : <ul>
+ : <li>parse JSON and convert it to XDM and</li>
+ : <li>serialize XDM in order to output JSON.</li>
+ : </ul>
+ : </p>
+ :
+ : <p>Both types of functions are available to parse and serialize two
+ : types of XDM-JSON mappings:<ul><li>the first mapping called in this document
+ : <strong>simple XDM-JSON</strong> has been
+ : <a href="http://john.snelson.org.uk/parsing-json-into-xquery">
+ : proposed by John Snelson</a></li><li>the second mapping is called
+ : <a href="http://jsonml.org/">JsonML</a></li></ul>In the following, we
+ : briefly describe both mappings.</p>
+ :
+ : <h2>Simple XDM-JSON Mapping</h2>
+ : <ul><li>In order to process JSON with XQuery, Zorba implements a mapping between
+ : JSON and XML that was initially proposed by John Snelson in his article
+ : <a href="http://snelson.org.uk/archives/2008/02/parsing_json_in.php#more"
+ : target="_blank">Parsing JSON into XQuery</a></li></ul>
+ :
+ : <h2>JsonML Mapping</h2>
+ : <ul>
+ : <li><a href="http://jsonml.org" target="_blank">JSonML</a> (JSON Markup Language)
+ : is an application of the JSON format.</li>
+ : <li>The purpose of JSonML is to provide a compact format for transporting
+ : XML-based markup as JSon. In contrast to the <strong>simple XDM-JSON</strong> mapping described above
+ : <strong>JsonML</strong> allows a lossless conversion back and forth.</li></ul>
+ :
+ : <h2>Important Notes:</h2>
+ : <ul><li>Zorba uses the <a href="http://www.digip.org/jansson/">Jansson library</a>
+ : for manipulating JSON data.</li>
+ : <li>We have tested against the following Jansson library versions:
+ : <ul><li><a href="http://www.digip.org/jansson/doc/1.2/">Jansson 1.2.1</a></li>
+ : <li><a href="http://www.digip.org/jansson/doc/1.3/">Jansson 1.3</a></li>
+ : <li><a href="http://www.digip.org/jansson/doc/2.0/">Jansson 2.0</a></li></ul> available from
+ : <a href="http://www.digip.org/jansson/releases/">Jansson releases</a>.</li></ul>
+ :
+ : @author Sorin Nasoi
+ : @library <a href="http://www.digip.org/jansson/">Jansson library for encoding, decoding and manipulating JSON data</a>
+ :
+ : @see <a href="http://john.snelson.org.uk/parsing-json-into-xquery">Mapping proposed by John Snelson</a>
+ : @see <a href="http://jsonml.org" target="_blank">JSonML</a>
+ : @see <a href="http://www.digip.org/jansson/doc/2.0/">Jansson library for encoding, decoding and manipulating JSON data</a>
+ : @project data processing/data converters
+ :
+ :)
+module namespace json = "http://www.zorba-xquery.com/modules/converters/json";
+
+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
+
+import schema namespace json-options = "http://www.zorba-xquery.com/modules/converters/json-options";
+
+declare namespace err = "http://www.w3.org/2005/xqt-errors";
+
+declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
+declare option ver:module-version "1.0";
+
+(:~
+ : This function parses a JSON string and returns an XDM instance according
+ : to either one of the mappings described above.
+ :
+ : @param $arg a sequence of valid JSON strings.
+ : @param $options a set of name and value pairs that provide options
+ : to configure the JSON mapping process that have to be validated against the
+ : "http://www.zorba-xquery.com/modules/converters/json-options" schema.
+ : @return a sequence of nodes according to either one of the mappings described above.
+ : @error err:XQDY0027 if $options can not be validated against the json-options schema
+ : @error json:ParseError if the JSON string passed as parameter is not
+ : valid JSON.
+ : @example test_json/Queries/converters/jansson/parse_json_02.xq
+ : @example test_json/Queries/converters/jansson/parse_json_ml_01.xq
+ :)
+declare function json:parse(
+ $arg as xs:string?,
+ $options as element(json-options:options)
+) as document-node(element(*, xs:untyped))
+{
+ let $validated-options := if(schema:is-validated($options)) then
+ $options
+ else
+ validate{$options}
+ return
+ json:parse-internal($arg, $validated-options)
+};
+
+(:~
+ : This function parses a JSON string and returns an XDM instance according
+ : to simple XDM-JSON mapping described above.
+ :
+ : @param $arg a sequence of valid JSON strings.
+ : @return a sequence of nodes according to Simple XDM-JSON mapping described above.
+ : @error json:ParseError if the JSON string passed as parameter is not
+ : valid JSON.
+ : @example test_json/Queries/converters/jansson/parse_json_11.xq
+ :)
+declare function json:parse(
+ $arg as xs:string?
+) as document-node(element(*, xs:untyped))
+{
+ json:parse-internal($arg,
+ validate {
+ <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" >
+ <json-param name="mapping" value="simple-json" />
+ </options>
+ }
+ )
+};
+
+(:~
+ : This function parses a JSON string and returns an XDM instance according
+ : to JsonML mapping described above.
+ :
+ : @param $arg a sequence of valid JSON strings.
+ : @return a sequence of nodes according the JSON-ML mapping described above.
+ : @error json:ParseError if the JSON string passed as parameter is not
+ : valid JSON.
+ : @example test_json/Queries/converters/jansson/parse_json_ml_05.xq
+ :)
+declare function json:parse-ml(
+ $arg as xs:string?
+) as document-node(element(*, xs:untyped))
+{
+ json:parse-internal($arg,
+ validate {
+ <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" >
+ <json-param name="mapping" value="json-ml" type="array"/>
+ </options>
+ }
+ )
+};
+
+declare %private function json:parse-internal(
+ $html as xs:string,
+ $options as element(json-options:options)?
+) as document-node(element(*, xs:untyped)) external;
+
+
+(:~
+ : The serialize function takes a sequence of nodes as parameter and
+ : transforms each element into a valid JSON string according to one of the
+ : mappings described above.
+ :
+ : @param $xml a sequence of nodes.
+ : @param $options a set of name and value pairs that provide options
+ : to configure the JSON mapping process that have to be validated against the
+ : "http://www.zorba-xquery.com/modules/converters/json-options" schema.
+ : @return a JSON string.
+ : @error err:XQDY0027 if $options can not be validated against the json-options schema
+ : @error json:InvalidXDM if the input $xml is not a valid XDM
+ : representation of JSON or JSON ML.
+ : @example test_json/Queries/converters/jansson/serialize_json_01.xq
+ : @example test_json/Queries/converters/jansson/serialize_json_ml_01.xq
+ :)
+declare function json:serialize(
+ $xml as item()*,
+ $options as element(json-options:options)
+) as xs:string
+{
+ let $validated-options := if(schema:is-validated($options)) then
+ $options
+ else
+ validate{$options}
+ return
+ json:serialize-internal($xml, $validated-options)
+};
+
+(:~
+ : The serialize function takes a sequence of nodes as parameter and
+ : transforms each element into a valid JSON string according to the
+ : Simple XDM-JSON mapping described above
+ :
+ : @param $xml a sequence of nodes.
+ : @return a JSON string.
+ : @error json:InvalidXDM if the input $xml is not a valid XDM
+ : representation of JSON or JSON ML.
+ : @example test_json/Queries/converters/jansson/serialize_json_18.xq
+ :)
+declare function json:serialize(
+ $xml as item()*
+) as xs:string
+{
+ json:serialize-internal($xml,
+ validate {
+ <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" >
+ <json-param name="mapping" value="simple-json" />
+ </options>
+ }
+ )
+};
+
+(:~
+ : The serialize function takes a sequence of nodes as parameter and
+ : transforms each element into a valid JSON string according to the
+ : JsonML mapping described above.
+ :
+ : @param $xml a sequence of nodes.
+ : @return a JSON string.
+ : @error json:InvalidXDM if the input $xml is not a valid XDM
+ : representation of JSON or JSON ML.
+ : @example test_json/Queries/converters/jansson/serialize_json_ml_04.xq
+ :)
+declare function json:serialize-ml(
+ $xml as item()*
+) as xs:string
+{
+ json:serialize-internal($xml,
+ validate {
+ <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" >
+ <json-param name="mapping" value="json-ml" type="array"/>
+ </options>
+ }
+ )
+};
+
+declare %private function json:serialize-internal(
+ $xml as item()*,
+ $options as element(json-options:options)?
+ ) as xs:string external;
=== added directory 'src/com/zorba-xquery/www/modules/converters/json.xq.src'
=== added file 'src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.cpp'
--- src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.cpp 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.cpp 2011-12-06 07:32:41 +0000
@@ -0,0 +1,729 @@
+/*
+ * Copyright 2006-2008 The FLWOR 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.
+ */
+
+#include <sstream>
+#include <cstring>
+
+#include <zorba/zorba.h>
+#include <zorba/iterator.h>
+#include <zorba/store_consts.h>
+
+#include <jansson.h>
+
+#include "jansson_wrapper.h"
+
+namespace zorba
+{
+namespace jsonmodule
+{
+static void serialize_child(
+ const zorba::Item& aElement,
+ std::stringstream& aResultSs,
+ std::stringstream& aErrorLogSs,
+ const std::string& aParentType);
+
+bool replace_all( std::string &s, char from, char to ) {
+ bool replaced_any = false;
+ for ( std::string::size_type pos = 0; pos < s.size(); ++pos ) {
+ if ( (pos = s.find( from, pos )) == std::string::npos )
+ break;
+ s.replace( pos, 1, 1, to );
+ replaced_any = true;
+ }
+ return replaced_any;
+}
+
+bool replace_all( std::string &s,
+ char const *from, std::string::size_type from_len,
+ char const *to, std::string::size_type to_len ) {
+ bool replaced_any = false;
+ for ( std::string::size_type pos = 0;
+ pos + from_len <= s.size(); pos += to_len ) {
+ if ( (pos = s.find( from, pos, from_len )) == std::string::npos )
+ break;
+ s.replace( pos, from_len, to, to_len );
+ replaced_any = true;
+ }
+ return replaced_any;
+}
+
+bool replace_all( std::string &s, char const *from, char const *to )
+{
+ return replace_all( s, from, std::strlen( from ), to, std::strlen( to ) );
+}
+
+void replace_special_chars(
+ std::string &aValue)
+{
+ replace_all(aValue, "\"", "\\\""); //quotation mark
+ replace_all(aValue, "\\", "\\\\"); //reverse solidus
+ replace_all(aValue, "/", "\\/"); //solidus
+ replace_all(aValue, "\b", "\\b" ); //backspace
+ replace_all(aValue, "\f", "\\f" ); //formfeed
+ replace_all(aValue, "\n", "\\n" ); //new line
+ replace_all(aValue, "\r", "\\r" ); //carriage return
+ replace_all(aValue, "\t", "\\t" ); //horizontal tab
+}
+
+static void parse_Json_value(
+ const char *aKey,
+ json_t *aValue,
+ const char* aParentType,
+ std::stringstream& aSs,
+ std::stringstream& aErrorLogSs)
+{
+ if(!aValue)
+ return;
+
+ switch(json_typeof(aValue))
+ {
+ case JSON_OBJECT:
+ {
+ const char *lKey;
+ json_t *lValue;
+ std::string lTmp(aKey);
+
+ //<pair name=\"[...]\" type=\"object\">[...]</pair>
+ aSs << "<pair";
+ if(!lTmp.empty())
+ aSs << " name=\"" << lTmp << "\"";
+ aSs << " type=\"object\">";
+
+ void *lIter = json_object_iter(aValue);
+ while(lIter)
+ {
+ lKey = json_object_iter_key(lIter);
+ lValue = json_object_iter_value(lIter);
+
+ parse_Json_value(lKey, lValue, "object", aSs, aErrorLogSs);
+
+ lIter = json_object_iter_next(aValue, lIter);
+ }
+
+ aSs << "</pair>";
+ break;
+ }
+ case JSON_ARRAY:
+ {
+ json_t *lValue;
+ zorba::String lName(aKey), lEmptyStr("");
+
+ //<pair name=\"[...]\" type=\"array\">[...]</pair>
+ aSs << "<pair name=\"" << lName << "\" type=\"array\">";
+
+ for(size_t i = 0; i < json_array_size(aValue); i++)
+ {
+ lValue = json_array_get(aValue, i);
+
+ parse_Json_value(lEmptyStr.c_str(), lValue, "array", aSs, aErrorLogSs);
+ }
+
+ aSs << "</pair>";
+ break;
+ }
+ default:
+ {
+ //only NULL does not have a value
+ bool lHaveVal = !(json_is_null(aValue));
+
+ std::string lType, lValue;
+ if(json_is_null(aValue))
+ {
+ lType = "null";
+ lValue = "null";
+ }
+ else if(json_is_string(aValue))
+ {
+ lType = "string";
+ lValue = json_string_value(aValue);
+ }
+ else if(json_is_number(aValue))
+ {
+ lType = "number";
+
+ //json_string_value works just for STRING items so we have to use
+ //json_number_value that returns a double
+ std::ostringstream lOss;
+ lOss << json_number_value(aValue);
+ lValue = lOss.str();
+ }
+ else if(json_is_boolean(aValue))
+ {
+ lType = "boolean";
+ lValue = json_is_true(aValue)?"true":"false";
+ }
+
+ zorba::String lName(aKey);
+ std::string lParent(aParentType);
+ std::string lItemName = (lParent.compare("object") == 0)?"pair":"item";
+
+
+ aSs << "<" << lItemName;
+ if(!lName.empty())
+ {
+ aSs <<" name=\"" << lName << "\"";
+ }
+ aSs << " type=\"" << lType;
+ if(lHaveVal)
+ {
+ replace_special_chars(lValue);
+ aSs << "\">" << lValue << "</" << lItemName << ">";
+ }
+ else
+ aSs << "\"/>";
+
+ break;
+ }
+ }
+}
+
+
+void JSON_parse(
+ const char* aJsonString,
+ std::stringstream& aSs,
+ std::stringstream& aErrorLogSs)
+{
+ json_error_t lerror;
+ json_t *ljson;
+
+ #if JANSSON_MAJOR_VERSION < 2
+ ljson = json_loads(aJsonString, &lerror);
+ #else
+ ljson = json_loads(aJsonString, 0, &lerror);
+ #endif
+
+ if(!ljson)
+ {
+ #if JANSSON_MAJOR_VERSION < 2
+ aErrorLogSs << "Error at line: " << lerror.line << std::endl;
+ aErrorLogSs << lerror.text << std::endl;
+ #else
+ aErrorLogSs << "Error at line: " << lerror.line << " column: " << lerror.column << " position: " << lerror.position << std::endl;
+ aErrorLogSs << lerror.text << std::endl;
+ #endif
+ return;
+ }
+
+ const char *lKey;
+ json_t *lValue;
+ lKey = json_object_iter_key(ljson);
+
+ if(json_is_object(ljson))
+ {
+ aSs << "<json type=\"object\">";
+ void *lIter = json_object_iter(ljson);
+ while(lIter)
+ {
+ lKey = json_object_iter_key(lIter);
+ lValue = json_object_iter_value(lIter);
+
+ parse_Json_value(lKey, lValue, "object", aSs, aErrorLogSs);
+
+ lIter = json_object_iter_next(ljson, lIter);
+ }
+ aSs << "</json>";
+ }
+ else if(json_is_array(ljson))
+ {
+ std::string lEmptyStr("");
+ aSs << "<json type=\"array\">";
+ for(size_t i = 0; i < json_array_size(ljson); i++)
+ {
+ lValue = json_array_get(ljson, i);
+
+ parse_Json_value(lEmptyStr.c_str(), lValue, "array", aSs, aErrorLogSs);
+ }
+ aSs << "</json>";
+ }
+ else
+ aErrorLogSs << "Either one of ARRAY and OBJECT are considered valid JSON." << std::endl;
+
+}
+
+void get_text_value(
+ const zorba::Item& aElement,
+ zorba::String& aValue)
+{
+ zorba::Iterator_t lChildrenIt;
+ zorba::Item lChild;
+
+ lChildrenIt = aElement.getChildren();
+ lChildrenIt->open();
+ while (lChildrenIt->next(lChild))
+ {
+ if (lChild.getNodeKind() == store::StoreConsts::textNode)
+ aValue = lChild.getStringValue();
+ }
+ lChildrenIt->close();
+}
+
+void serialize_element(
+ const zorba::Item& aElement,
+ std::stringstream& aResultSs,
+ std::stringstream& aErrorLogSs,
+ const std::string& aParentType)
+{
+ zorba::Iterator_t lAttrIt, lChildrenIt;
+ zorba::Item lAttr, lChild;
+ zorba::String lName, lType;
+
+ Item lNodeNameItem;
+ aElement.getNodeName(lNodeNameItem);
+
+ if(((aParentType.compare("object") == 0) &&
+ !(lNodeNameItem.getStringValue() == "pair" || lNodeNameItem.getStringValue() == "json")) ||
+ ((aParentType.compare("array") == 0) && lNodeNameItem.getStringValue() != "item"))
+ {
+ aErrorLogSs << "'Object' should have only 'pair' children and 'array' should have only 'item' children." << std::endl;
+ return;
+ }
+
+ lAttrIt = aElement.getAttributes();
+ lAttrIt->open();
+ while (lAttrIt->next(lAttr))
+ {
+ if(lAttr.getNodeKind() == store::StoreConsts::attributeNode)
+ {
+ Item lNodeNameItem;
+ lAttr.getNodeName(lNodeNameItem);
+ if(lNodeNameItem.getStringValue() == "type")
+ lType = lAttr.getStringValue();
+ else if(lNodeNameItem.getStringValue() == "name")
+ lName = lAttr.getStringValue();
+ }
+ }
+ lAttrIt->close();
+
+ if(lType.empty())
+ {
+ aErrorLogSs << "Element does not have a 'type' attribute defined." << std::endl;
+ return;
+ }
+
+ if(lType == "object")
+ {
+ if(!lName.empty())
+ aResultSs << "\"" << lName.c_str() << "\": ";
+
+ //serialize every children
+ aResultSs << "{";
+ serialize_child(aElement, aResultSs, aErrorLogSs, "object");
+ aResultSs << "}";
+ }
+ else if(lType == "array")
+ {
+ if(!lName.empty())
+ aResultSs << "\"" << lName.c_str() << "\": ";
+
+ //serialize every children
+ aResultSs << "[";
+ serialize_child(aElement, aResultSs, aErrorLogSs, "array");
+ aResultSs << "]";
+ }
+ else if(lType == "string")
+ {
+ zorba::String lValue;
+ get_text_value(aElement, lValue);
+ zorba::Item lNodeNameItem;
+ aElement.getNodeName(lNodeNameItem);
+ if(lNodeNameItem.getStringValue() == "pair")
+ {
+ if(lName.empty())
+ {
+ aErrorLogSs << "Element does not have a 'name' attribute defined." << std::endl;
+ return;
+ }
+ if(aParentType.compare("object") != 0)
+ {
+ aErrorLogSs << "'Pair' is allowed only as part of an object." << std::endl;
+ return;
+ }
+ aResultSs << "\"" << lName.c_str() << "\": ";
+ }
+ aResultSs << "\"" << lValue.c_str() << "\"";
+ }
+ else if(lType == "null")
+ {
+ zorba::Item lNodeNameItem;
+ aElement.getNodeName(lNodeNameItem);
+ if(lNodeNameItem.getStringValue() == "pair")
+ {
+ aResultSs << "\"" << lName.c_str() << "\": ";
+ }
+ aResultSs << "null";
+ }
+ else if(lType == "number" ||
+ lType == "boolean")
+ {
+ zorba::String lValue;
+ get_text_value(aElement, lValue);
+ zorba::Item lNodeNameItem;
+ aElement.getNodeName(lNodeNameItem);
+ if(lNodeNameItem.getStringValue() == "pair")
+ {
+ aResultSs << "\"" << lName.c_str() << "\": ";
+ }
+ aResultSs << lValue.c_str();
+ }
+ else
+ {
+ aErrorLogSs << "Type '" << lType.c_str() << "' not recognized." << std::endl;
+ return;
+ }
+}
+
+void serialize_child(
+ const zorba::Item& aElement,
+ std::stringstream& aResultSs,
+ std::stringstream& aErrorLogSs,
+ const std::string& aParentType)
+{
+ bool lFirst = true;
+ zorba::Iterator_t lChildrenIt;
+ zorba::Item lChild;
+
+ lChildrenIt = aElement.getChildren();
+ lChildrenIt->open();
+ while (lChildrenIt->next(lChild))
+ {
+ if(lChild.getNodeKind() == store::StoreConsts::elementNode)
+ {
+ if(!lFirst)
+ aResultSs << ", ";
+
+ serialize_element(lChild, aResultSs, aErrorLogSs, aParentType);
+ lFirst = false;
+ }
+ }
+ lChildrenIt->close();
+}
+
+void JSON_serialize(
+ const zorba::Item& aElement,
+ std::stringstream& aResultSs,
+ std::stringstream& aErrorLogSs)
+{
+ if (aElement.isNull())
+ {
+ aErrorLogSs << "Passed a NULL element to the JSON serializer." << std::endl;
+ return;
+ }
+
+ if(!(aElement.getNodeKind() == store::StoreConsts::documentNode ||
+ aElement.getNodeKind() == store::StoreConsts::elementNode))
+ {
+ aErrorLogSs << "Passed an incorrect Item to the JSON serializer." << std::endl;
+ return;
+ }
+
+ Item lNodeNameItem;
+ aElement.getNodeName(lNodeNameItem);
+
+ if(!lNodeNameItem.isNull() && lNodeNameItem.getStringValue() != "json")
+ {
+ aErrorLogSs << "This is not a JSON element." << std::endl;
+ return;
+ }
+
+ if(aElement.getNodeKind() == store::StoreConsts::documentNode)
+ {
+ serialize_child(aElement, aResultSs, aErrorLogSs, "object");
+ return;
+ }
+
+ zorba::Iterator_t lAttrIt;
+ zorba::Item lAttr;
+ zorba::String lType;
+ lAttrIt = aElement.getAttributes();
+ lAttrIt->open();
+ while (lAttrIt->next(lAttr))
+ {
+ if(lAttr.getNodeKind() == store::StoreConsts::attributeNode)
+ {
+ Item lNodeNameItem;
+ lAttr.getNodeName(lNodeNameItem);
+ if(lNodeNameItem.getStringValue() == "type")
+ lType = lAttr.getStringValue();
+ else
+ {
+ aErrorLogSs << "Could not retrieve the type of the Json root." << std::endl;
+ return;
+ }
+ }
+ }
+ lAttrIt->close();
+
+
+ if(lType == "object")
+ aResultSs << "{";
+ else
+ aResultSs << "[";
+
+ serialize_child(aElement, aResultSs, aErrorLogSs, "object");
+
+ if(aErrorLogSs.str().empty())
+ {
+ if(lType == "object")
+ aResultSs << "}";
+ else
+ aResultSs << "]";
+ }
+}
+
+static void parse_JSON_ML_value(
+ const char *aKey,
+ json_t *aValue,
+ const char* aParentType,
+ std::stringstream& aSs,
+ std::stringstream& aErrorLogSs,
+ bool aShouldClose = false)
+{
+ if(!aValue)
+ return;
+
+ switch(json_typeof(aValue))
+ {
+ case JSON_OBJECT:
+ {
+ const char *lKey;
+ json_t *lValue;
+ std::string lTmp(aKey);
+
+ void *lIter = json_object_iter(aValue);
+ while(lIter)
+ {
+ lKey = json_object_iter_key(lIter);
+ lValue = json_object_iter_value(lIter);
+
+ parse_JSON_ML_value(lKey, lValue, "object", aSs, aErrorLogSs);
+
+ lIter = json_object_iter_next(aValue, lIter);
+ }
+ aSs << ">";
+ break;
+ }
+ case JSON_ARRAY:
+ {
+ json_t *lValue;
+ zorba::String lName(""), lEmptyStr("");
+ bool lShouldClose = true;
+
+ std::string lParent(aParentType);
+ if(lParent.compare("array") == 0)
+ {
+ for(size_t i = 0; i < json_array_size(aValue); i++)
+ {
+ lValue = json_array_get(aValue, i);
+
+ if(json_is_object(lValue))
+ lShouldClose = false;
+ }
+
+ aSs << "<";
+ }
+
+ std::string lTmp;
+ for(size_t i = 0; i < json_array_size(aValue); i++)
+ {
+ lValue = json_array_get(aValue, i);
+
+ parse_JSON_ML_value(lEmptyStr.c_str(), lValue, "array", aSs, aErrorLogSs, lShouldClose);
+
+ if(lShouldClose)
+ lShouldClose = false;
+ }
+
+ lValue = json_array_get(aValue, 0);
+ if(json_is_string(lValue))
+ lName = json_string_value(lValue);
+
+ if(lParent.compare("array") == 0)
+ aSs << "</" << lName << ">";
+
+ break;
+ }
+ default:
+ {
+ zorba::String lType, lValue;
+ if(json_is_string(aValue))
+ {
+ lType = "string";
+ lValue = json_string_value(aValue);
+ }
+ else if(json_is_boolean(aValue))
+ {
+ lType = json_is_true(aValue)?"true":"false";
+ lValue = lType;
+ }
+ else if(json_is_number(aValue))
+ {
+ lType = "number";
+
+ //json_string_value works just for STRING items so we have to use
+ //json_number_value that returns a double
+ std::ostringstream lOss;
+ lOss << json_number_value(aValue);
+ lValue = lOss.str();
+ }
+ else if(json_is_null(aValue))
+ {
+ lType = lValue = "null";
+ }
+
+ zorba::String lName(aKey);
+ std::string lParent(aParentType);
+
+ if(lParent.compare("array") == 0)
+ aSs << lValue;
+ else if(lParent.compare("object") == 0)
+ {
+ aSs << " " << lName << "=";
+ if(lType.compare("string") == 0)
+ aSs << "\"" << lValue << "\"";
+ else
+ aSs << lValue;
+ }
+
+ if(aShouldClose)
+ aSs << ">";
+
+ break;
+ }
+ }
+}
+
+void JSON_ML_parse(
+ const char* aJsonString,
+ std::stringstream& aSs,
+ std::stringstream& aErrorLogSs)
+{
+ json_error_t lerror;
+ json_t *ljson;
+ zorba::String lEmptyStr("");
+
+ #if JANSSON_MAJOR_VERSION < 2
+ ljson = json_loads(aJsonString, &lerror);
+ #else
+ ljson = json_loads(aJsonString, 0, &lerror);
+ #endif
+ if(!ljson)
+ {
+ #if JANSSON_MAJOR_VERSION < 2
+ aErrorLogSs << "Error at line: " << lerror.line << std::endl;
+ aErrorLogSs << lerror.text << std::endl;
+ #else
+ aErrorLogSs << "Error at line: " << lerror.line << " column: " << lerror.column << " position: " << lerror.position << std::endl;
+ aErrorLogSs << lerror.text << std::endl;
+ #endif
+ return;
+ }
+
+ if(!json_is_array(ljson))
+ aErrorLogSs << "ARRAY is the only accepted root for the Json-ML mapping." << std::endl;
+
+ parse_JSON_ML_value(lEmptyStr.c_str(), ljson, "array", aSs, aErrorLogSs);
+}
+
+void JSON_ML_serialize(
+ const zorba::Item& aElement,
+ std::stringstream& aResultSs,
+ std::stringstream& aErrorLogSs)
+{
+ if (aElement.isNull())
+ {
+ aErrorLogSs << "Passed a NULL element to the JSON serializer." << std::endl;
+ return;
+ }
+
+ if(!(aElement.getNodeKind() == store::StoreConsts::documentNode ||
+ aElement.getNodeKind() == store::StoreConsts::elementNode ||
+ aElement.getNodeKind() == store::StoreConsts::textNode))
+ {
+ aErrorLogSs << "Passed an incorrect Item to the JSON serializer." << std::endl;
+ return;
+ }
+
+ if(aElement.getNodeKind() == store::StoreConsts::textNode)
+ {
+ aResultSs << "\"" << aElement.getStringValue().c_str() << "\"";
+ return;
+ }
+
+ Item lNodeNameItem;
+ aElement.getNodeName(lNodeNameItem);
+
+ aResultSs << "[\"" << lNodeNameItem.getStringValue().c_str() << "\"";
+
+ zorba::Iterator_t lAttrIt;
+ zorba::Item lAttr;
+ zorba::String lType;
+ bool lHasAttributes = false;
+
+ lAttrIt = aElement.getAttributes();
+ lAttrIt->open();
+ while (lAttrIt->next(lAttr))
+ {
+ if(lAttr.getNodeKind() == store::StoreConsts::attributeNode)
+ {
+ lHasAttributes = true;
+ break;
+ }
+ }
+ lAttrIt->close();
+
+ if(lHasAttributes)
+ aResultSs << ",{";
+
+ bool lFirst = true;
+ lAttrIt = aElement.getAttributes();
+ lAttrIt->open();
+ while (lAttrIt->next(lAttr))
+ {
+ if(lAttr.getNodeKind() == store::StoreConsts::attributeNode)
+ {
+ Item lNodeNameItem;
+ lAttr.getNodeName(lNodeNameItem);
+ if(!lFirst)
+ aResultSs << ",";
+
+ aResultSs << "\"" << lNodeNameItem.getStringValue().c_str() << "\":";
+ aResultSs << "\"" << lAttr.getStringValue().c_str() << "\"";
+ lFirst = false;
+ }
+ }
+ lAttrIt->close();
+ if(lHasAttributes)
+ aResultSs << "}";
+
+ zorba::Iterator_t lChildrenIt;
+ zorba::Item lChild;
+
+ lChildrenIt = aElement.getChildren();
+ lChildrenIt->open();
+ while (lChildrenIt->next(lChild))
+ {
+ aResultSs << ",";
+ if (lChild.getNodeKind() == store::StoreConsts::elementNode ||
+ lChild.getNodeKind() == store::StoreConsts::textNode)
+ JSON_ML_serialize(lChild, aResultSs, aErrorLogSs);
+ }
+ lChildrenIt->close();
+
+ aResultSs << "]";
+}
+
+ } /* namespace jsonmodule */
+} /* namespace zorba */
=== added file 'src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.h'
--- src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.h 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.h 2011-12-06 07:32:41 +0000
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2006-2008 The FLWOR 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.
+ */
+
+#ifndef ZORBA_JSONMODULE_JANSSON_WRAPPER_H
+#define ZORBA_JSONMODULE_JANSSON_WRAPPER_H
+
+#include <zorba/item_factory.h>
+#include <zorba/item.h>
+
+namespace zorba
+{
+ namespace jsonmodule
+ {
+ //Json parse and serialize: http://www.json.org/
+ //according to the mapping proposed by john snelson:
+ //http://snelson.org.uk/archives/2008/02/parsing_json_in.php#more
+ void JSON_parse(
+ const char* aJsonString,
+ std::stringstream& aSs,
+ std::stringstream& aErrorLogSs);
+
+ void JSON_serialize(
+ const zorba::Item& aElement,
+ std::stringstream& aResultSs,
+ std::stringstream& aErrorLogSs);
+
+
+ //Json ML parse and serialize: http://jsonml.org/
+ void JSON_ML_parse(
+ const char* aJsonString,
+ std::stringstream& aSs,
+ std::stringstream& aErrorLogSs);
+
+
+ void JSON_ML_serialize(
+ const zorba::Item& aElement,
+ std::stringstream& aResultSs,
+ std::stringstream& aErrorLogSs);
+
+ } /* namespace jsonmodule */
+} /* namespace zorba */
+
+#endif //ZORBA_JSONMODULE_JANSSON_WRAPPER_H
\ No newline at end of file
=== added file 'src/com/zorba-xquery/www/modules/converters/json.xq.src/json.cpp'
--- src/com/zorba-xquery/www/modules/converters/json.xq.src/json.cpp 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/json.xq.src/json.cpp 2011-12-06 07:32:41 +0000
@@ -0,0 +1,317 @@
+/*
+ * Copyright 2006-2008 The FLWOR 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.
+ */
+
+#include <sstream>
+#include <cassert>
+
+#include <zorba/empty_sequence.h>
+#include <zorba/singleton_item_sequence.h>
+#include <zorba/diagnostic_list.h>
+#include <zorba/user_exception.h>
+#include <zorba/item.h>
+#include <zorba/store_consts.h>
+
+#include "json.h"
+#include "jansson_wrapper.h"
+
+namespace zorba
+{
+ namespace jsonmodule
+ {
+zorba::String
+JsonFunction::getOptionValue(zorba::Item& aOptionsItem, const char* aOptionName) const
+{
+ zorba::Iterator_t lChildrenIt, lAttrIt;
+ zorba::Item lChild, lAttr, lNodeNameItem;
+ bool lCorrectChild = false;
+
+ lChildrenIt = aOptionsItem.getChildren();
+ lChildrenIt->open();
+ while (lChildrenIt->next(lChild))
+ {
+ if (lChild.getNodeKind() == store::StoreConsts::elementNode)
+ {
+ lAttrIt = lChild.getAttributes();
+ lAttrIt->open();
+ while (lAttrIt->next(lAttr))
+ {
+ if(lAttr.getNodeKind() == store::StoreConsts::attributeNode)
+ {
+ lAttr.getNodeName(lNodeNameItem);
+ if(!lCorrectChild &&
+ lNodeNameItem.getStringValue() == "name")
+ lCorrectChild = lAttr.getStringValue() == "mapping";
+ else if(lCorrectChild &&
+ lNodeNameItem.getStringValue() == "value")
+ return lAttr.getStringValue();
+ }
+ }
+ }
+ }
+ lChildrenIt->close();
+
+ return zorba::String("");
+}
+//*****************************************************************************
+//*****************************************************************************
+
+ParseFunction::ParseFunction(const JsonModule* aModule)
+: JsonFunction(aModule)
+{
+}
+
+ItemSequence_t
+ParseFunction::evaluate(
+ const ExternalFunction::Arguments_t& aArgs,
+ const StaticContext* aSctxCtx,
+ const DynamicContext* aDynCtx) const
+ {
+ zorba::Item lStringItem, lOptionsItem, lResItem;
+ zorba::String lBaseUri, lJsonMapping, lOptionName("mapping");
+ std::stringstream lSs, lErrorLogSs;
+
+ if (aArgs.size() >= 1)
+ {
+ Iterator_t lArg0Iter = aArgs[0]->getIterator();
+ lArg0Iter->open();
+ lArg0Iter->next(lStringItem);
+ lArg0Iter->close();
+ }
+
+ lBaseUri = aSctxCtx->getBaseURI();
+
+ if (aArgs.size() == 2)
+ {
+ Iterator_t lArg0Iter = aArgs[1]->getIterator();
+ lArg0Iter->open();
+ lArg0Iter->next(lOptionsItem);
+ lArg0Iter->close();
+ }
+
+ lJsonMapping = getOptionValue(lOptionsItem, lOptionName.c_str());
+
+ if(lJsonMapping == "simple-json")
+ {
+ JSON_parse(lStringItem.getStringValue().c_str(), lSs, lErrorLogSs);
+ }
+ else // if(lJsonMapping == "json-ml")
+ {
+ assert(lJsonMapping == "json-ml"); // the schema makes sure that this is the case
+ JSON_ML_parse(lStringItem.getStringValue().c_str(), lSs, lErrorLogSs);
+ }
+
+ if(!lErrorLogSs.str().empty())
+ {
+ zorba::Item lError = theModule->getItemFactory()->createQName(theModule->getURI(), "ParseError");
+ throw USER_EXCEPTION(lError, lErrorLogSs.str());
+ }
+
+ XmlDataManager* lDataManager = Zorba::getInstance(0)->getXmlDataManager();
+ Item lItem = lDataManager->parseXML(lSs);
+
+ return ItemSequence_t(new SingletonItemSequence(lItem));
+ }
+
+//*****************************************************************************
+//*****************************************************************************
+SerializeFunction::StringStreamSequence::StringStreamSequence(ItemSequence* input)
+ : input_iter(input->getIterator()),
+ is(new std::istream(this))
+{
+ line_index = 0;
+ has_next = true;
+ is_open = false;
+ open_count = 0;
+ input_iter->open();
+}
+
+void SerializeFunction::StringStreamSequence::open()
+{
+ is_open = true;
+ line_index = 1;
+ if(open_count)
+ {
+ is->seekg(0);
+ if(is->fail())
+ throw USER_EXCEPTION(theFactory->createQName(
+ "http://www.zorba-xquery.com/modules/converters/json",
+ "InvalidStream"),
+ "Cannot reset streamable string item");
+ }
+ open_count++;
+}
+
+void SerializeFunction::StringStreamSequence::close()
+{
+ is_open = false;
+}
+
+bool SerializeFunction::StringStreamSequence::isOpen() const
+{
+ return is_open;
+}
+
+bool SerializeFunction::StringStreamSequence::next( Item &result )
+{
+ assert(is_open);
+
+ if(!has_next)
+ return false;
+ result = streamable_item;
+ has_next = false;
+ return true;
+}
+
+bool SerializeFunction::StringStreamSequence::next(std::string &result_string)
+{
+ if(!input_iter->next(node_item))
+ return false;
+
+ std::stringstream lSs, lErrorLogSs;
+
+ if(theMapping == "simple-json")
+ JSON_serialize(node_item, lSs, lErrorLogSs);
+ else if(theMapping == "json-ml")
+ JSON_ML_serialize(node_item, lSs, lErrorLogSs);
+
+ if(!lErrorLogSs.str().empty())
+ {
+ throw USER_EXCEPTION(
+ theFactory->createQName(
+ "http://www.zorba-xquery.com/modules/converters/json",
+ "InvalidXDM"),
+ lErrorLogSs.str());
+ }
+
+ result_string = lSs.str();
+ return true;
+}
+
+bool SerializeFunction::StringStreamSequence::reset()
+{
+ input_iter->close();
+ input_iter->open();
+ return true;
+}
+
+
+SerializeFunction::SerializeFunction(const JsonModule* aModule)
+: JsonFunction(aModule)
+{
+}
+
+ItemSequence_t
+SerializeFunction::evaluate(
+ const ExternalFunction::Arguments_t& aArgs,
+ const StaticContext* aSctxCtx,
+ const DynamicContext* aDynCtx) const
+ {
+ zorba::Item lOptionsItem, lResItem;
+ zorba::String lBaseUri, lJsonMapping, lOptionName("mapping");
+ std::stringstream lSs, lErrorLogSs;
+
+ lBaseUri = aSctxCtx->getBaseURI();
+
+ if (aArgs.size() == 2)
+ {
+ Iterator_t lArg0Iter = aArgs[1]->getIterator();
+ lArg0Iter->open();
+ lArg0Iter->next(lOptionsItem);
+ lArg0Iter->close();
+ }
+
+ lJsonMapping = getOptionValue(lOptionsItem, lOptionName.c_str());
+
+ if(lJsonMapping != "simple-json" &&
+ lJsonMapping != "json-ml")
+ {
+ zorba::Item lError = theModule->getItemFactory()->createQName(theModule->getURI(), "WrongParam");
+ lErrorLogSs << "Mapping type '" << lJsonMapping << "' not supported.\nPossible values are 'simple-json' or 'json-ml'.";
+ throw USER_EXCEPTION(lError, lErrorLogSs.str());
+ }
+
+ StringStreamSequence *stream_sequence = new StringStreamSequence((ItemSequence*)aArgs[0]);
+ stream_sequence->theMapping = lJsonMapping;
+ stream_sequence->theFactory = theModule->getItemFactory();
+ stream_sequence->streamable_item =
+ theModule->getItemFactory()->createStreamableString(
+ *(stream_sequence->is), &StringStreamSequence::releaseStream);
+
+ return ItemSequence_t(stream_sequence);
+
+ }
+
+//*****************************************************************************
+//*****************************************************************************
+
+ItemFactory* JsonModule::theFactory = 0;
+
+JsonModule::~JsonModule()
+{
+ for ( FuncMap_t::const_iterator lIter = theFunctions.begin();
+ lIter != theFunctions.end();
+ ++lIter)
+ {
+ delete lIter->second;
+ }
+ theFunctions.clear();
+}
+
+ExternalFunction*
+JsonModule::getExternalFunction(const String& aLocalname)
+{
+ ExternalFunction*& lFunc = theFunctions[aLocalname];
+ if (!lFunc)
+ {
+ if (1 == 0)
+ { }
+ else if (aLocalname == "parse-internal")
+ {
+ lFunc = new ParseFunction(this);
+ }
+ else if (aLocalname == "serialize-internal")
+ {
+ lFunc = new SerializeFunction(this);
+ }
+ }
+ return lFunc;
+}
+
+void
+JsonModule::destroy()
+{
+ if (!dynamic_cast<JsonModule*>(this))
+ {
+ return;
+ }
+ delete this;
+}
+//*****************************************************************************
+//*****************************************************************************
+
+ } /* namespace jsonmodule */
+} /* namespace zorba */
+
+#ifdef WIN32
+# define DLL_EXPORT __declspec(dllexport)
+#else
+# define DLL_EXPORT __attribute__ ((visibility("default")))
+#endif
+
+extern "C" DLL_EXPORT zorba::ExternalModule* createModule()
+{
+ return new zorba::jsonmodule::JsonModule();
+}
=== added file 'src/com/zorba-xquery/www/modules/converters/json.xq.src/json.h'
--- src/com/zorba-xquery/www/modules/converters/json.xq.src/json.h 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/json.xq.src/json.h 2011-12-06 07:32:41 +0000
@@ -0,0 +1,167 @@
+/*
+ * Copyright 2006-2008 The FLWOR 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.
+ */
+#ifndef ZORBA_JSONMODULE_JSON_H
+#define ZORBA_JSONMODULE_JSON_H
+
+#include <map>
+
+#include <zorba/zorba.h>
+#include <zorba/iterator.h>
+#include <zorba/function.h>
+#include <zorba/external_module.h>
+
+#include "stringiterator_streambuf.h"
+
+namespace zorba
+{
+ namespace jsonmodule
+ {
+//*****************************************************************************
+//*****************************************************************************
+ class JsonModule : public ExternalModule
+ {
+ private:
+ static ItemFactory* theFactory;
+
+ protected:
+ class ltstr
+ {
+ public:
+ bool operator()(const String& s1, const String& s2) const
+ {
+ return s1.compare(s2) < 0;
+ }
+ };
+
+ typedef std::map<String, ExternalFunction*, ltstr> FuncMap_t;
+
+ FuncMap_t theFunctions;
+
+ public:
+ virtual ~JsonModule();
+
+ virtual String
+ getURI() const { return "http://www.zorba-xquery.com/modules/converters/json"; }
+
+ virtual ExternalFunction*
+ getExternalFunction(const String& aLocalname);
+
+ virtual void
+ destroy();
+
+ static ItemFactory*
+ getItemFactory()
+ {
+ if(!theFactory)
+ {
+ theFactory = Zorba::getInstance(0)->getItemFactory();
+ }
+ return theFactory;
+ }
+ };
+
+//*****************************************************************************
+//*****************************************************************************
+ class JsonFunction : public ContextualExternalFunction
+ {
+ protected:
+ const JsonModule* theModule;
+ zorba::String getOptionValue(zorba::Item& aOptionsItem, const char* aOptionName) const;
+ public:
+ JsonFunction(const JsonModule* aModule)
+ : theModule(aModule) {};
+
+ ~JsonFunction() {};
+
+ virtual String
+ getURI() const { return theModule->getURI(); }
+
+ };
+
+//*****************************************************************************
+//*****************************************************************************
+ class ParseFunction : public JsonFunction
+ {
+ public:
+ ParseFunction(const JsonModule* aModule);
+
+ virtual String
+ getLocalName() const { return "parse-internal"; }
+
+ virtual ItemSequence_t
+ evaluate(const ExternalFunction::Arguments_t& args,
+ const StaticContext* aSctxCtx,
+ const DynamicContext* aDynCtx) const;
+ };
+
+ class SerializeFunction : public JsonFunction
+ {
+ class StringStreamSequence : public ItemSequence, public Iterator, public StringIteratorStreamBuf
+ {
+ private:
+ Iterator_t input_iter;
+ std::vector<std::vector<String> > headers;
+ int line_index;
+ bool has_next;
+ bool is_open;
+ int open_count;
+
+ std::vector<String> line;
+ Item node_item;
+ public:
+ std::istream* is;
+ String theMapping;
+ ItemFactory* theFactory;
+ Item streamable_item;
+ public:
+ StringStreamSequence(ItemSequence* input);
+ virtual ~StringStreamSequence() {}
+
+ //for Iterator
+ virtual void open();
+ virtual void close();
+ virtual bool isOpen() const;
+ virtual bool next( Item &result );
+
+ //for ItemSequence
+ Iterator_t getIterator() {return this;}
+
+ //for StringIteratorStreamBuf
+ virtual bool next(std::string &next_string);
+ virtual bool reset();
+
+ static void
+ releaseStream(std::istream* stream) { delete stream; }
+
+ };
+ public:
+ SerializeFunction(const JsonModule* aModule);
+
+ virtual String
+ getLocalName() const { return "serialize-internal"; }
+
+ virtual ItemSequence_t
+ evaluate(const ExternalFunction::Arguments_t& args,
+ const StaticContext* aSctxCtx,
+ const DynamicContext* aDynCtx) const;
+ };
+
+
+
+ } /* namespace jsonmodule */
+} /* namespace zorba */
+
+#endif /* ZORBA_JSONMODULE_JSON_H */
=== added file 'src/com/zorba-xquery/www/modules/converters/json.xq.src/stringiterator_streambuf.cpp'
--- src/com/zorba-xquery/www/modules/converters/json.xq.src/stringiterator_streambuf.cpp 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/json.xq.src/stringiterator_streambuf.cpp 2011-12-06 07:32:41 +0000
@@ -0,0 +1,153 @@
+/*
+ * Copyright 2006-2008 The FLWOR 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.
+ */
+
+#include <zorba/diagnostic_list.h>
+
+#include "stringiterator_streambuf.h"
+
+using namespace std;
+namespace zorba{
+
+StringIteratorStreamBuf::StringIteratorStreamBuf()
+{
+ current_buffer = 0;
+ last_buffer = 0;
+ begin_offset = 0;
+ is_eof = false;
+}
+
+//get next buffer
+int StringIteratorStreamBuf::underflow()
+{
+ if(is_eof)
+ return EOF;
+
+ begin_offset += buffer[current_buffer].length();
+ current_buffer = 1 - current_buffer;
+ if(last_buffer != current_buffer)
+ {
+ buffer[current_buffer].resize(0);
+ last_buffer = current_buffer;
+ if(!next(buffer[current_buffer]))
+ {
+ //current_buffer = 1 - current_buffer;
+ buffer[current_buffer].resize(0);
+ is_eof = true;
+ return EOF;
+ }
+ }
+
+ char *buffstr = (char*)buffer[current_buffer].c_str();
+ setg(buffstr, buffstr, buffstr+buffer[current_buffer].length());
+ return *buffstr;
+}
+
+//unget char, some special cases
+int StringIteratorStreamBuf::pbackfail ( int c )
+{
+ if(eback() != gptr())
+ {
+ setg(eback(), gptr()-1, egptr());
+ if(c != EOF)
+ *gptr() = (char)c;
+ return 1;
+ }
+
+ //else have to rewind to previous buffer
+ if(last_buffer != current_buffer)
+ return EOF;
+ if(buffer[1-last_buffer].length() == 0)
+ return EOF;
+ current_buffer = 1 - current_buffer;
+
+ begin_offset -= buffer[current_buffer].length();
+ char *buffstr = (char*)buffer[current_buffer].c_str();
+ setg(buffstr, buffstr+buffer[current_buffer].length()-1, buffstr+buffer[current_buffer].length());
+ if(c != EOF)
+ *gptr() = (char)c;
+ return 1;
+}
+
+//set a new position
+//if going too much back, restart the iterator
+streampos StringIteratorStreamBuf::seekoff ( streamoff off, ios_base::seekdir way, ios_base::openmode which )
+{
+ if(!(which & ios_base::in))
+ return -1;
+
+ streampos targetpos;
+ if(way == ios_base::end)
+ {
+ if(off > 0)
+ return -1;
+ while(underflow() != EOF);
+ streampos maxpos = begin_offset + (streamoff)buffer[current_buffer].length();
+ targetpos = maxpos + off;
+ }
+ else if(way == ios_base::cur)
+ {
+ targetpos = begin_offset + (streamoff)(gptr() - eback()) + off;
+ }
+ else if(way == ios_base::beg)
+ {
+ if(off < 0)
+ return -1;
+ targetpos = off;
+ }
+ else
+ return -1;
+ return seekpos(targetpos, ios_base::in);
+}
+
+//set a new position
+//if going too much back, restart the iterator
+streampos StringIteratorStreamBuf::seekpos ( streampos sp, ios_base::openmode which )
+{
+ if(!(which & ios_base::in))
+ return -1;
+
+ if(sp < begin_offset)
+ {
+ setg(eback(), eback(), egptr());
+ pbackfail(EOF);
+ if(sp < begin_offset)
+ {
+ //restart the iterator
+ if(!reset())
+ return -1;
+ buffer[0].resize(0);
+ buffer[1].resize(0);
+ current_buffer = last_buffer = 0;
+ begin_offset = 0;
+ is_eof = false;
+ setg(NULL, NULL, NULL);
+ }
+ }
+ while(sp >= (begin_offset+(streamoff)buffer[current_buffer].length()))
+ {
+ if(underflow() == EOF)
+ {
+ if(sp == (begin_offset+(streamoff)buffer[current_buffer].length()))
+ break;
+ return -1;
+ }
+ }
+
+ setg(eback(), eback() + (streamoff)(sp - begin_offset), egptr());
+ return sp;
+}
+
+}
=== added file 'src/com/zorba-xquery/www/modules/converters/json.xq.src/stringiterator_streambuf.h'
--- src/com/zorba-xquery/www/modules/converters/json.xq.src/stringiterator_streambuf.h 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/json.xq.src/stringiterator_streambuf.h 2011-12-06 07:32:41 +0000
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2006-2008 The FLWOR 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.
+ */
+
+#include <stdio.h>
+#include <streambuf>
+#include <istream>
+
+#ifndef STRING_ITERATOR_TO_STREAMBUF_IMPL
+#define STRING_ITERATOR_TO_STREAMBUF_IMPL
+
+namespace zorba{
+
+class StringIteratorStreamBuf : public std::streambuf
+{
+ std::string buffer[2];
+ int current_buffer;
+ int last_buffer;
+ std::streampos begin_offset;
+ bool is_eof;
+public:
+ StringIteratorStreamBuf();
+ virtual ~StringIteratorStreamBuf() {}
+
+ virtual int underflow ( );
+ virtual int pbackfail ( int c = EOF );
+
+ virtual std::streampos seekoff ( std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out );
+ virtual std::streampos seekpos ( std::streampos sp, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out );
+
+public:
+ virtual bool next(std::string &next_string) = 0;
+ virtual bool reset() = 0;
+};
+
+}
+#endif
=== added file 'src/com/zorba-xquery/www/modules/converters/streambuftest.cpp'
--- src/com/zorba-xquery/www/modules/converters/streambuftest.cpp 1970-01-01 00:00:00 +0000
+++ src/com/zorba-xquery/www/modules/converters/streambuftest.cpp 2011-12-06 07:32:41 +0000
@@ -0,0 +1,270 @@
+/*
+ * Copyright 2006-2008 The FLWOR 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.
+ */
+#include <string.h>
+#include "csv.xq.src/stringiterator_streambuf.h"
+#include <istream>
+#include <stdio.h>
+
+class TestStreambuf : public zorba::StringIteratorStreamBuf
+{
+ std::string strings[3];
+ int current_string;
+ int max_repetitions;
+public:
+ TestStreambuf(int _max_repetitions = 1) : max_repetitions(_max_repetitions)
+ {
+ strings[0] = "ab";
+ strings[1] = "cde";
+ strings[2] = "f";
+
+ current_string = 0;
+ }
+ virtual ~TestStreambuf() {}
+
+ virtual bool next(std::string &next_string)
+ {
+ if(current_string >= 3)
+ {
+ max_repetitions--;
+ if(!max_repetitions)
+ return false;
+ else
+ current_string = 0;
+ }
+ next_string = strings[current_string++];
+ return true;
+ }
+ virtual bool reset()
+ {
+ current_string = 0;
+ return true;
+ }
+
+};
+
+bool test1()
+{
+ TestStreambuf sbuf;
+ std::istream *is = new std::istream(&sbuf);
+
+ char result[100];
+ memset(result, 0, sizeof(result));
+ is->read(result, sizeof(result));
+ if(strcmp(result, "abcdef"))
+ return false;
+ return true;
+}
+
+bool test2()
+{
+ TestStreambuf sbuf;
+ std::istream *is = new std::istream(&sbuf);
+
+ std::string result;
+ while(!is->eof())
+ {
+ char c;
+ (*is)>>c;
+ if(is->eof())
+ break;
+ result += c;
+ }
+ if(result.compare("abcdef"))
+ return false;
+ return true;
+}
+
+bool test3()
+{
+ TestStreambuf sbuf;
+ std::istream *is = new std::istream(&sbuf);
+
+ std::string result;
+ char c;
+ (*is)>>c;//a
+ result += c;
+ is->unget();
+ (*is)>>c;//a
+ result += c;
+ if(result.compare("aa"))
+ return false;
+ return true;
+}
+
+bool test4()
+{
+ TestStreambuf sbuf;
+ std::istream *is = new std::istream(&sbuf);
+
+ std::string result;
+ char c;
+ (*is)>>c;//a
+ result += c;
+ (*is)>>c;//b
+ result += c;
+ (*is)>>c;//c
+ result += c;
+ is->unget();
+ is->unget();
+ (*is)>>c;//b
+ result += c;
+ (*is)>>c;//c
+ result += c;
+ is->unget();
+ is->putback('t');
+ (*is)>>c;//t
+ result += c;
+ if(result.compare("abcbct"))
+ return false;
+ return true;
+}
+
+bool test5()
+{
+ TestStreambuf sbuf;
+ std::istream *is = new std::istream(&sbuf);
+
+ std::string result;
+ char c;
+ (*is)>>c;//a
+ result += c;
+ (*is)>>c;//b
+ result += c;
+ (*is)>>c;//c
+ result += c;
+ is->seekg(1);
+ c = 0;
+ (*is)>>c;//b
+ result += c;
+ (*is)>>c;//c
+ result += c;
+ if(result.compare("abcbc"))
+ return false;
+ return true;
+}
+
+bool test6()
+{
+ TestStreambuf sbuf;
+ std::istream *is = new std::istream(&sbuf);
+
+ std::string result;
+ char c;
+ is->seekg(-1, std::ios::end);
+ c = 0;
+ (*is)>>c;//f
+ result += c;
+ if(result.compare("f"))
+ return false;
+ return true;
+}
+
+bool test7()
+{
+ TestStreambuf sbuf;
+ std::istream *is = new std::istream(&sbuf);
+
+ std::string result;
+ char c;
+ is->seekg(1, std::ios::cur);
+ c = 0;
+ (*is)>>c;//b
+ result += c;
+ if(result.compare("b"))
+ return false;
+ is->seekg(-2, std::ios::cur);
+ c = 0;
+ (*is)>>c;//a
+ result += c;
+ if(result.compare("ba"))
+ return false;
+ is->seekg(5, std::ios::beg);
+ c = 0;
+ (*is)>>c;//f
+ result += c;
+ if(result.compare("baf"))
+ return false;
+ is->seekg(4);
+ c = 0;
+ (*is)>>c;//e
+ result += c;
+ if(result.compare("bafe"))
+ return false;
+ return true;
+}
+
+bool test8()
+{
+ TestStreambuf sbuf(10 * 1000 * 1000);
+ std::istream *is = new std::istream(&sbuf);
+
+ char result[100];
+ memset(result, 0, sizeof(result));
+ do{
+ is->read(result, 6);
+ if(is->eof())
+ break;
+ if(strcmp(result, "abcdef"))
+ return false;
+ }while(!is->eof());
+ return true;
+}
+
+
+int streambuftest (int argc, char* argv[])
+{
+ if(!test1())
+ {
+ printf("streamable string streambuf test1 failed!\n");
+ return 1;
+ }
+ if(!test2())
+ {
+ printf("streamable string streambuf test2 failed!\n");
+ return 1;
+ }
+ if(!test3())
+ {
+ printf("streamable string streambuf test3 failed!\n");
+ return 1;
+ }
+ if(!test4())
+ {
+ printf("streamable string streambuf test4 failed!\n");
+ return 1;
+ }
+ if(!test5())
+ {
+ printf("streamable string streambuf test5 failed!\n");
+ return 1;
+ }
+ if(!test6())
+ {
+ printf("streamable string streambuf test6 failed!\n");
+ return 1;
+ }
+ if(!test7())
+ {
+ printf("streamable string streambuf test7 failed!\n");
+ return 1;
+ }
+ if(!test8())
+ {
+ printf("streamable string streambuf test8 failed!\n");
+ return 1;
+ }
+ return 0;
+}
=== added directory 'test'
=== renamed directory 'test' => 'test.moved'
=== added directory 'test/ExpQueryResults'
=== added directory 'test/ExpQueryResults/converters'
=== added directory 'test/ExpQueryResults/converters/base64'
=== added file 'test/ExpQueryResults/converters/base64/base64.xml.res'
--- test/ExpQueryResults/converters/base64/base64.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/converters/base64/base64.xml.res 2011-12-06 07:32:41 +0000
@@ -0,0 +1,1 @@
+This is a test
=== added file 'test/ExpQueryResults/converters/base64/binaryReadWrite.xml.res'
--- test/ExpQueryResults/converters/base64/binaryReadWrite.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/converters/base64/binaryReadWrite.xml.res 2011-12-06 07:32:41 +0000
@@ -0,0 +1,1 @@
+SUCCESS
\ No newline at end of file
=== added directory 'test/ExpQueryResults/converters/csv'
=== added file 'test/ExpQueryResults/converters/csv/csv_parse1.xml.res'
--- test/ExpQueryResults/converters/csv/csv_parse1.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/converters/csv/csv_parse1.xml.res 2011-12-06 07:32:41 +0000
@@ -0,0 +1,6 @@
+<row>
+ <column>f1</column>
+ <column> f2</column>
+ <column> f3</column>
+ <column> f4</column>
+</row>
\ No newline at end of file
=== added file 'test/ExpQueryResults/converters/csv/csv_parse10.xml.res'
--- test/ExpQueryResults/converters/csv/csv_parse10.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/converters/csv/csv_parse10.xml.res 2011-12-06 07:32:41 +0000
@@ -0,0 +1,4929 @@
+<row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>ALGER</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04057529"</Staid>
+ <Place_Name>WEST BRANCH WHITEFISH RIVER NEAR DIFFIN MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>ALGER</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04057529"</Staid>
+ <Place_Name>WEST BRANCH WHITEFISH RIVER NEAR DIFFIN MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>DELTA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04057577"</Staid>
+ <Place_Name>CHIPPENY CREEK NEAR RAPID RIVER MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>DELTA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04057658"</Staid>
+ <Place_Name>DAYS RIVER NEAR BRAMPTON MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>DELTA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04058980"</Staid>
+ <Place_Name>HUNTERS BROOK NEAR CORNELL MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>DELTA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040590305"</Staid>
+ <Place_Name>ESCANABA RIVER AT LAMBERT MI</Place_Name>
+ <Land_Use_Group>MIXED</Land_Use_Group>
+ <Land_Use_Code>mx</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>DELTA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04059597"</Staid>
+ <Place_Name>BARK RIVER NEAR BARK RIVER MI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>IRON</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04061050"</Staid>
+ <Place_Name>SOUTH BRANCH PAINT RIVER NEAR ELMWOOD MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>IRON</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04061050"</Staid>
+ <Place_Name>SOUTH BRANCH PAINT RIVER NEAR ELMWOOD MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>IRON</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04061200"</Staid>
+ <Place_Name>WEST BRANCH NET RIVER NEAR PARK SIDING MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>IRON</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04061245"</Staid>
+ <Place_Name>EAST BRANCH NET RIVER NEAR PARK SIDING MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>IRON</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04062462"</Staid>
+ <Place_Name>FENCE RIVER NEAR MICHIGAMME MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>MARQUETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04057950"</Staid>
+ <Place_Name>BLACK RIVER NEAR REPUBLIC MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>MARQUETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04058120"</Staid>
+ <Place_Name>GREEN CREEK NEAR PALMER MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>MARQUETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04058305"</Staid>
+ <Place_Name>EAST BRANCH ESCANABA RIVER NEAR PALMER MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>MARQUETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04062085"</Staid>
+ <Place_Name>PESHEKEE RIVER NEAR MARTINS LANDING MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>rf</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>MARQUETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04062085"</Staid>
+ <Place_Name>PESHEKEE RIVER NEAR MARTINS LANDING MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>rf</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>33</Ammonia__wf>
+ <Nitrite__wf>33</Nitrite__wf>
+ <Ammonia___organic-N__w>33</Ammonia___organic-N__w>
+ <NH3_orgN__wu>33</NH3_orgN__wu>
+ <NO3_NO2__wf>33</NO3_NO2__wf>
+ <Phosphorus__wu>33</Phosphorus__wu>
+ <Phosphorus__wf>33</Phosphorus__wf>
+ <Orthophosphate__wf>33</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>MARQUETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04062190"</Staid>
+ <Place_Name>WEST BRANCH PESHEKEE RIVER NEAR CHAMPION MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>MENOMINEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04059400"</Staid>
+ <Place_Name>TENMILE CREEK AT PERRONVILLE MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>MENOMINEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04059620"</Staid>
+ <Place_Name>DEER CREEK NEAR FOX MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>MENOMINEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04059685"</Staid>
+ <Place_Name>CEDAR RIVER NEAR SPALDING MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>MENOMINEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04059715"</Staid>
+ <Place_Name>FORTY SEVEN MILE CREEK NEAR HOULE MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>MENOMINEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04059758"</Staid>
+ <Place_Name>BIG BROOK NEAR PALESTINE MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>MI</State_Postal_Code>
+ <State>MICHIGAN</State>
+ <County>MENOMINEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04067080"</Staid>
+ <Place_Name>LITTLE CEDAR RIVER NEAR BAGLEY MI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>ADAMS</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072657"</Staid>
+ <Place_Name>NEENAH CREEK NEAR OXFORD WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>ADAMS</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072749"</Staid>
+ <Place_Name>LAWRENCE CREEK NEAR LAWRENCE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04071990"</Staid>
+ <Place_Name>SUAMICO RIVER AT FLINTVILLE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072150"</Staid>
+ <Place_Name>DUCK CREEK NEAR HOWARD WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>cr</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>95</Ammonia__wf>
+ <Nitrite__wf>95</Nitrite__wf>
+ <Ammonia___organic-N__w>95</Ammonia___organic-N__w>
+ <NH3_orgN__wu>96</NH3_orgN__wu>
+ <NO3_NO2__wf>95</NO3_NO2__wf>
+ <Phosphorus__wu>96</Phosphorus__wu>
+ <Phosphorus__wf>95</Phosphorus__wf>
+ <Orthophosphate__wf>95</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072225"</Staid>
+ <Place_Name>BEAVER DAM CREEK NEAR HOWARD WI</Place_Name>
+ <Land_Use_Group>URBAN</Land_Use_Group>
+ <Land_Use_Code>ur</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072233"</Staid>
+ <Place_Name>LANCASTER BROOK AT SHAWANO AVENUE AT HOWARD WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>28</Ammonia__wf>
+ <Nitrite__wf>28</Nitrite__wf>
+ <Ammonia___organic-N__w>25</Ammonia___organic-N__w>
+ <NH3_orgN__wu>25</NH3_orgN__wu>
+ <NO3_NO2__wf>28</NO3_NO2__wf>
+ <Phosphorus__wu>28</Phosphorus__wu>
+ <Phosphorus__wf>25</Phosphorus__wf>
+ <Orthophosphate__wf>28</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>3</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04084940"</Staid>
+ <Place_Name>PLUM CREEK NEAR CT HIGHWAY ZZ NEAR WRIGHTSTOWN WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085046"</Staid>
+ <Place_Name>APPLE CREEK AT SNIDERVILLE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>5</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085051"</Staid>
+ <Place_Name>APPLE CREEK NEAR WRIGHTSTOWN WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085068"</Staid>
+ <Place_Name>ASHWAUBENON CREEK NEAR LITTLE RAPIDS WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>1</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>1</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040850683"</Staid>
+ <Place_Name>ASHWAUBENON CREEK AT SOUTH BRIDGE RD NR DEPERE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>1</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>1</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085091"</Staid>
+ <Place_Name>EAST RIVER @ LAMERS & CLANCY RD NEAR GREENLEAF WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040850926"</Staid>
+ <Place_Name>UNNAMED EAST RIVER TRIBUTARY #1 NEAR GREENLEAF WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040850928"</Staid>
+ <Place_Name>EAST RIVER NEAR GREENLEAF WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085094"</Staid>
+ <Place_Name>UNNAMED EAST RIVER TRIBUTARY #2 NEAR GREENLEAF WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085095"</Staid>
+ <Place_Name>UNNAMED EAST RIVER TRIBUTARY NEAR WRIGHTSTOWN WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085098"</Staid>
+ <Place_Name>UNNAMED EAST RIVER TRIBUTARY #3 NEAR GREENLEAF WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>3</Ammonia__wf>
+ <Nitrite__wf>3</Nitrite__wf>
+ <Ammonia___organic-N__w>3</Ammonia___organic-N__w>
+ <NH3_orgN__wu>3</NH3_orgN__wu>
+ <NO3_NO2__wf>3</NO3_NO2__wf>
+ <Phosphorus__wu>3</Phosphorus__wu>
+ <Phosphorus__wf>3</Phosphorus__wf>
+ <Orthophosphate__wf>3</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040851046"</Staid>
+ <Place_Name>EAST RIVER AT PARTRIDGE ROAD NEAR GREENLEAF WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040851048"</Staid>
+ <Place_Name>UNNAMED EAST RIVER TRIBUTARY #4 NEAR GREENLEAF WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085105"</Staid>
+ <Place_Name>EAST RIVER AT WRIGHTSTOWN ROAD NEAR GREENLEAF WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085107"</Staid>
+ <Place_Name>EAST RIVER TRIBUTARY NEAR GREENLEAF WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085108"</Staid>
+ <Place_Name>EAST RIVER AT CT HIGHWAY ZZ NEAR GREENLEAF WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>cr</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>13</Ammonia__wf>
+ <Nitrite__wf>13</Nitrite__wf>
+ <Ammonia___organic-N__w>13</Ammonia___organic-N__w>
+ <NH3_orgN__wu>15</NH3_orgN__wu>
+ <NO3_NO2__wf>14</NO3_NO2__wf>
+ <Phosphorus__wu>15</Phosphorus__wu>
+ <Phosphorus__wf>13</Phosphorus__wf>
+ <Orthophosphate__wf>13</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085109"</Staid>
+ <Place_Name>EAST RIVER AT MIDWAY ROAD NEAR DE PERE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>cr</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085109"</Staid>
+ <Place_Name>EAST RIVER AT MIDWAY ROAD NEAR DE PERE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>cr</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>26</Ammonia__wf>
+ <Nitrite__wf>26</Nitrite__wf>
+ <Ammonia___organic-N__w>26</Ammonia___organic-N__w>
+ <NH3_orgN__wu>26</NH3_orgN__wu>
+ <NO3_NO2__wf>26</NO3_NO2__wf>
+ <Phosphorus__wu>26</Phosphorus__wu>
+ <Phosphorus__wf>26</Phosphorus__wf>
+ <Orthophosphate__wf>26</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085110"</Staid>
+ <Place_Name>EAST RIVER @ CTH PP IN BROWN COUNTY NR DE PERE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>cr</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085110"</Staid>
+ <Place_Name>EAST RIVER @ CTH PP IN BROWN COUNTY NR DE PERE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>cr</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040851235"</Staid>
+ <Place_Name>BOWER CREEK TRIB AT LIME KILN ROAD NR BELLEVUE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040851325"</Staid>
+ <Place_Name>BAIRD CREEK AT SUPERIOR ROAD AT GREEN BAY WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>6</Ammonia__wf>
+ <Nitrite__wf>6</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>6</NO3_NO2__wf>
+ <Phosphorus__wu>7</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>6</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>6</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>6</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085139"</Staid>
+ <Place_Name>FOX RIVER AT MOUTH AT GREEN BAY WI</Place_Name>
+ <Land_Use_Group>MIXED</Land_Use_Group>
+ <Land_Use_Code>mx</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>2</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085139"</Staid>
+ <Place_Name>FOX RIVER AT MOUTH AT GREEN BAY WI</Place_Name>
+ <Land_Use_Group>MIXED</Land_Use_Group>
+ <Land_Use_Code>mx</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>26</Ammonia__wf>
+ <Nitrite__wf>26</Nitrite__wf>
+ <Ammonia___organic-N__w>26</Ammonia___organic-N__w>
+ <NH3_orgN__wu>26</NH3_orgN__wu>
+ <NO3_NO2__wf>26</NO3_NO2__wf>
+ <Phosphorus__wu>26</Phosphorus__wu>
+ <Phosphorus__wf>26</Phosphorus__wf>
+ <Orthophosphate__wf>26</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>BROWN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085310"</Staid>
+ <Place_Name>NESHOTA RIVER NEAR DENMARK WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>CALUMET</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040850875"</Staid>
+ <Place_Name>EAST RIVER NEAR FOREST JUNCTION WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>COLUMBIA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072410"</Staid>
+ <Place_Name>FOX RIVER NEAR PARDEEVILLE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>COLUMBIA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072711"</Staid>
+ <Place_Name>BIG SLOUGH NEAR BRIGGSVILLE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>DOOR</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085170"</Staid>
+ <Place_Name>HIBBARD CREEK AT JACKSONPORT WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FLORENCE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04063674"</Staid>
+ <Place_Name>POPPLE RIVER NEAR LONG LAKE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FLORENCE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04063679"</Staid>
+ <Place_Name>MORGAN CREEK NEAR FENCE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FLORENCE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04063688"</Staid>
+ <Place_Name>SOUTH BRANCH POPPLE RIVER NEAR NEWALD WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FLORENCE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04063700"</Staid>
+ <Place_Name>POPPLE RIVER NEAR FENCE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>rf</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>3</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FLORENCE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04063700"</Staid>
+ <Place_Name>POPPLE RIVER NEAR FENCE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>rf</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>92</Ammonia__wf>
+ <Nitrite__wf>91</Nitrite__wf>
+ <Ammonia___organic-N__w>50</Ammonia___organic-N__w>
+ <NH3_orgN__wu>72</NH3_orgN__wu>
+ <NO3_NO2__wf>92</NO3_NO2__wf>
+ <Phosphorus__wu>92</Phosphorus__wu>
+ <Phosphorus__wf>50</Phosphorus__wf>
+ <Orthophosphate__wf>92</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>30</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>20</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOND DU LAC</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040734644"</Staid>
+ <Place_Name>SILVER CREEK AT SOUTH KORO ROAD NEAR RIPON WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOND DU LAC</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04083500"</Staid>
+ <Place_Name>EAST BRANCH FOND DU LAC RIVER AT FOND DU LAC WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOND DU LAC</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085475"</Staid>
+ <Place_Name>SHEBOYGAN RIVER AT DOTYVILLE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOND DU LAC</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040854805"</Staid>
+ <Place_Name>SHEBOYGAN RIVER NEAR ST. CLOUD WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOND DU LAC</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086104"</Staid>
+ <Place_Name>MILWAUKEE RIVER AT CT HWY Y AT CAMPBELLSPORT WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOND DU LAC</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086139"</Staid>
+ <Place_Name>WEST BRANCH MILWAUKEE RIVER NEAR KEWASKUM WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOND DU LAC</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086198"</Staid>
+ <Place_Name>EAST BRANCH MILWAUKEE RIVER NEAR NEW FANE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOND DU LAC</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086200"</Staid>
+ <Place_Name>EAST BRANCH MILWAUKEE RIVER AT NEW FANE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOREST</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04063631"</Staid>
+ <Place_Name>PINE RIVER NEAR WINDSOR DAM NEAR ALVIN WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOREST</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040636722"</Staid>
+ <Place_Name>POPPLE RIVER NEAR NEWALD WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOREST</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040636728"</Staid>
+ <Place_Name>LITTLE POPPLE RIVER NEAR NEWALD WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOREST</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04067690"</Staid>
+ <Place_Name>SOUTH BRANCH PESHTIGO RIVER NEAR ARGONNE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOREST</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04067892"</Staid>
+ <Place_Name>RAT RIVER @ CNTY TRNK HIGHWAY H AT BLACKWELL WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOREST</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04069800"</Staid>
+ <Place_Name>NORTH BRANCH OCONTO RIVER NEAR CARTER WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOREST</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04074505"</Staid>
+ <Place_Name>SWAMP CREEK AT KEITH SIDING RD NEAR CRANDON WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOREST</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040745072"</Staid>
+ <Place_Name>HEMLOCK CREEK NEAR CRANDON WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOREST</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04074537"</Staid>
+ <Place_Name>SWAMP CREEK ABOVE HIGHWAY 55 NEAR MOLE LAKE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>FOREST</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04074549"</Staid>
+ <Place_Name>SWAMP CREEK NEAR MOLE LAKE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>GREEN LAKE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04073069"</Staid>
+ <Place_Name>GRAND RIVER TRIBUTARY NEAR KINGSTON WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>3</NH3_orgN__wu>
+ <NO3_NO2__wf>3</NO3_NO2__wf>
+ <Phosphorus__wu>3</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>GREEN LAKE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04073100"</Staid>
+ <Place_Name>BELLE FOUNTAIN CREEK NEAR KINGSTON WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>GREEN LAKE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04073452"</Staid>
+ <Place_Name>SUCKER CREEK NEAR PRINCETON WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>GREEN LAKE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04073500"</Staid>
+ <Place_Name>FOX RIVER AT BERLIN WI</Place_Name>
+ <Land_Use_Group>MIXED</Land_Use_Group>
+ <Land_Use_Code>mx</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>KENOSHA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04087258"</Staid>
+ <Place_Name>PIKE RIVER AT CTH A NEAR KENOSHA WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>6</Ammonia__wf>
+ <Nitrite__wf>6</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>6</NO3_NO2__wf>
+ <Phosphorus__wu>6</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>6</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>6</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>6</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>KENOSHA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04087270"</Staid>
+ <Place_Name>PIKE CREEK AT 43RD STREET AT KENOSHA WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>KENOSHA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="05527729"</Staid>
+ <Place_Name>KILBOURN DITCH AT 6OTH STREET NEAR KENOSHA WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>KEWAUNEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085188"</Staid>
+ <Place_Name>RIO CREEK AT PHEASANT ROAD NEAR RIO CREEK WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>6</Ammonia__wf>
+ <Nitrite__wf>6</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>6</NO3_NO2__wf>
+ <Phosphorus__wu>6</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>6</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>6</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>6</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>KEWAUNEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040851932"</Staid>
+ <Place_Name>KEWAUNEE RIVER TRIB @ LOWELL ROAD NR LUXEMBURG WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>KEWAUNEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040851958"</Staid>
+ <Place_Name>KEWAUNEE RIVER NEAR CASCO WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>KEWAUNEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085197"</Staid>
+ <Place_Name>CASCO CREEK NEAR CASCO WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>KEWAUNEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040851987"</Staid>
+ <Place_Name>LITTLE SCARBORO CREEK NEAR LUXEMBURG WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>KEWAUNEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085233"</Staid>
+ <Place_Name>KROK CREEK NEAR ELLISVILLE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>KEWAUNEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085240"</Staid>
+ <Place_Name>EAST TWIN RIVER NEAR TISCH MILLS WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>KEWAUNEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040852508"</Staid>
+ <Place_Name>TISCH MILLS CREEK AT TISCH MILLS WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>KEWAUNEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040853145"</Staid>
+ <Place_Name>BLACK CREEK AT CURRAN ROAD NEAR DENMARK WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>6</Ammonia__wf>
+ <Nitrite__wf>6</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>6</NO3_NO2__wf>
+ <Phosphorus__wu>6</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>6</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>6</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>6</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>LANGLADE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04074486"</Staid>
+ <Place_Name>WOLF RIVER AT TURTLE LAKE ROAD AT POST LAKE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>LANGLADE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04074620"</Staid>
+ <Place_Name>WOLF RIVER NEAR POST LAKE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>LANGLADE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04075050"</Staid>
+ <Place_Name>WOLF RIVER AT HIGHWAY M NEAR LANGLADE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>LANGLADE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04075050"</Staid>
+ <Place_Name>WOLF RIVER AT HIGHWAY M NEAR LANGLADE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MANITOWOC</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085270"</Staid>
+ <Place_Name>JAMBO CREEK AT JAMBO CREEK ROAD NEAR MISHICOT WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MANITOWOC</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085322"</Staid>
+ <Place_Name>DEVILS RIVER AT ROSENCRANS ROAD NEAR MARIBEL WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MANITOWOC</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085323"</Staid>
+ <Place_Name>DEVILS RIVER NEAR DENMARK WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MANITOWOC</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040854395"</Staid>
+ <Place_Name>POINT CREEK AT UCKER POINT ROAD NEAR NEWTON WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MANITOWOC</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085455"</Staid>
+ <Place_Name>MEEME RIVER AT WASHINGTON ROAD NEAR CLEVELAND WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARATHON</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04079589"</Staid>
+ <Place_Name>CAMP CREEK NEAR GALLOWAY WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARATHON</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04079608"</Staid>
+ <Place_Name>LITTLE WOLF RIVER NEAR ST HWY 49 NEAR GALLOWAY WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARINETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04066500"</Staid>
+ <Place_Name>PIKE RIVER AT AMBERG WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>27</Ammonia__wf>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w>27</Ammonia___organic-N__w>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>27</NO3_NO2__wf>
+ <Phosphorus__wu/>
+ <Phosphorus__wf>27</Phosphorus__wf>
+ <Orthophosphate__wf>26</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARINETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04066690"</Staid>
+ <Place_Name>WAUSAUKEE RIVER NEAR WAUSAUKEE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARINETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04067500"</Staid>
+ <Place_Name>MENOMINEE RIVER NEAR MC ALLISTER WI</Place_Name>
+ <Land_Use_Group>MIXED</Land_Use_Group>
+ <Land_Use_Code>mx</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARINETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04067500"</Staid>
+ <Place_Name>MENOMINEE RIVER NEAR MC ALLISTER WI</Place_Name>
+ <Land_Use_Group>MIXED</Land_Use_Group>
+ <Land_Use_Code>mx</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>31</Ammonia__wf>
+ <Nitrite__wf>31</Nitrite__wf>
+ <Ammonia___organic-N__w>31</Ammonia___organic-N__w>
+ <NH3_orgN__wu>31</NH3_orgN__wu>
+ <NO3_NO2__wf>31</NO3_NO2__wf>
+ <Phosphorus__wu>31</Phosphorus__wu>
+ <Phosphorus__wf>31</Phosphorus__wf>
+ <Orthophosphate__wf>31</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARINETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04067651"</Staid>
+ <Place_Name>MENOMINEE RIVER AT MOUTH AT MARINETTE WI</Place_Name>
+ <Land_Use_Group>MIXED</Land_Use_Group>
+ <Land_Use_Code>mx</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARINETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04068200"</Staid>
+ <Place_Name>THUNDER RIVER NEAR LAKEWOOD WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARINETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04069200"</Staid>
+ <Place_Name>MIDDLE INLET AT CAMP ROAD NEAR MIDDLE INLET WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARINETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04069343"</Staid>
+ <Place_Name>SOUTH BRANCH BEAVER CREEK NEAR POUND WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARINETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04069390"</Staid>
+ <Place_Name>LITTLE PESHTIGO RIVER NEAR COLEMAN WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARQUETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072665"</Staid>
+ <Place_Name>NEENAH CREEK NR CNTY TRNK HIGHWAY A NR OXFORD WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARQUETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072690"</Staid>
+ <Place_Name>WIDOW GREEN CREEK NEAR BRIGGSVILLE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARQUETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072732"</Staid>
+ <Place_Name>GOOD EARTH CREEK NEAR ENDEAVOR WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARQUETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04073230"</Staid>
+ <Place_Name>MECAN RIVER AT 14TH AVENUE NEAR RICHFORD WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARQUETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04073248"</Staid>
+ <Place_Name>CHAFFEE CREEK NEAR NESHKORO WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARQUETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04073300"</Staid>
+ <Place_Name>CHAFFEE CREEK AT NESHKORO WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARQUETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04073300"</Staid>
+ <Place_Name>CHAFFEE CREEK AT NESHKORO WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MARQUETTE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04073302"</Staid>
+ <Place_Name>CHAFFEE CREEK NEAR BUDSIN WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MENOMINEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04075350"</Staid>
+ <Place_Name>EVERGREEN RIVER AT CTH WW NEAR LANGLADE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MENOMINEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04075365"</Staid>
+ <Place_Name>EVERGREEN RIVER BLW EVERGREEN FALLS NR LANGLADE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>34</Ammonia__wf>
+ <Nitrite__wf>8</Nitrite__wf>
+ <Ammonia___organic-N__w>26</Ammonia___organic-N__w>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>34</NO3_NO2__wf>
+ <Phosphorus__wu>8</Phosphorus__wu>
+ <Phosphorus__wf>26</Phosphorus__wf>
+ <Orthophosphate__wf>34</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>8</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MENOMINEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04075860"</Staid>
+ <Place_Name>LITTLE W. BR. WOLF R. AT MILL POND AT NEOPIT WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MILWAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040869415"</Staid>
+ <Place_Name>LINCOLN CREEK AT 47TH STREET AT MILWAUKEE WI</Place_Name>
+ <Land_Use_Group>URBAN</Land_Use_Group>
+ <Land_Use_Code>ur</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>2</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MILWAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040869415"</Staid>
+ <Place_Name>LINCOLN CREEK AT 47TH STREET AT MILWAUKEE WI</Place_Name>
+ <Land_Use_Group>URBAN</Land_Use_Group>
+ <Land_Use_Code>ur</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>127</Ammonia__wf>
+ <Nitrite__wf>127</Nitrite__wf>
+ <Ammonia___organic-N__w>34</Ammonia___organic-N__w>
+ <NH3_orgN__wu>75</NH3_orgN__wu>
+ <NO3_NO2__wf>127</NO3_NO2__wf>
+ <Phosphorus__wu>126</Phosphorus__wu>
+ <Phosphorus__wf>34</Phosphorus__wf>
+ <Orthophosphate__wf>127</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>40</Particulate-N__suspend>
+ <Total_nitrogen__wf>10</Total_nitrogen__wf>
+ <Total_nitrogen__wu>51</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MILWAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086950"</Staid>
+ <Place_Name>LINCOLN CREEK AT MILWAUKEE WI</Place_Name>
+ <Land_Use_Group>URBAN</Land_Use_Group>
+ <Land_Use_Code>ur</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MILWAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04087000"</Staid>
+ <Place_Name>MILWAUKEE RIVER AT MILWAUKEE WI</Place_Name>
+ <Land_Use_Group>MIXED</Land_Use_Group>
+ <Land_Use_Code>mx</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>2</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MILWAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04087000"</Staid>
+ <Place_Name>MILWAUKEE RIVER AT MILWAUKEE WI</Place_Name>
+ <Land_Use_Group>MIXED</Land_Use_Group>
+ <Land_Use_Code>mx</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>143</Ammonia__wf>
+ <Nitrite__wf>143</Nitrite__wf>
+ <Ammonia___organic-N__w>99</Ammonia___organic-N__w>
+ <NH3_orgN__wu>133</NH3_orgN__wu>
+ <NO3_NO2__wf>142</NO3_NO2__wf>
+ <Phosphorus__wu>142</Phosphorus__wu>
+ <Phosphorus__wf>99</Phosphorus__wf>
+ <Orthophosphate__wf>143</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>32</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>9</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MILWAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04087070"</Staid>
+ <Place_Name>LITTLE MENOMONEE RIVER AT MILWAUKEE WI</Place_Name>
+ <Land_Use_Group>URBAN</Land_Use_Group>
+ <Land_Use_Code>ur</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>1</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>1</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MILWAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04087118"</Staid>
+ <Place_Name>HONEY CREEK NEAR PORTLAND AVENUE AT WAUWATOSA WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>5</Ammonia__wf>
+ <Nitrite__wf>5</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>5</NO3_NO2__wf>
+ <Phosphorus__wu>5</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>5</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>5</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>5</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MILWAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04087119"</Staid>
+ <Place_Name>HONEY CREEK AT WAUWATOSA WI</Place_Name>
+ <Land_Use_Group>URBAN</Land_Use_Group>
+ <Land_Use_Code>ur</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MILWAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04087150"</Staid>
+ <Place_Name>KINNICKINNIC RIVER AT S 27TH ST AT MILWAUKEE WI</Place_Name>
+ <Land_Use_Group>URBAN</Land_Use_Group>
+ <Land_Use_Code>ur</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MILWAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040871605"</Staid>
+ <Place_Name>KINNICKINNIC RIVER AT CHASE AVE AT MILWAUKEE WI</Place_Name>
+ <Land_Use_Group>URBAN</Land_Use_Group>
+ <Land_Use_Code>ur</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MILWAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04087170"</Staid>
+ <Place_Name>MILWAUKEE RIVER AT MOUTH AT MILWAUKEE WI</Place_Name>
+ <Land_Use_Group>MIXED</Land_Use_Group>
+ <Land_Use_Code>mx</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MILWAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04087204"</Staid>
+ <Place_Name>OAK CREEK AT SOUTH MILWAUKEE WI</Place_Name>
+ <Land_Use_Group>URBAN</Land_Use_Group>
+ <Land_Use_Code>ur</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>32</Ammonia__wf>
+ <Nitrite__wf>5</Nitrite__wf>
+ <Ammonia___organic-N__w>27</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>33</NO3_NO2__wf>
+ <Phosphorus__wu>6</Phosphorus__wu>
+ <Phosphorus__wf>27</Phosphorus__wf>
+ <Orthophosphate__wf>32</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>5</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>5</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MILWAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04087213"</Staid>
+ <Place_Name>ROOT RIVER AT LAYTON AVENUE AT GREENFIELD WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>MILWAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04087220"</Staid>
+ <Place_Name>ROOT RIVER NEAR FRANKLIN WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>1</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>1</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OCONTO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04070300"</Staid>
+ <Place_Name>WAUPEE CREEK NEAR MOUNTAIN WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OCONTO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04070606"</Staid>
+ <Place_Name>SOUTH BRANCH OCONTO RIVER NEAR BOULDER LAKE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OCONTO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04070640"</Staid>
+ <Place_Name>SECOND SOUTH BRANCH OCONTO RIVER NEAR MOUNTAIN WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OCONTO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04070850"</Staid>
+ <Place_Name>PESHTIGO BROOK NEAR SURING WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OCONTO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04071720"</Staid>
+ <Place_Name>KELLY BROOK NEAR OCONTO FALLS WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OCONTO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04071830"</Staid>
+ <Place_Name>NORTH BRANCH PENSAUKEE RIVER NEAR MORGAN WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OCONTO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04071903"</Staid>
+ <Place_Name>LITTLE SUAMICO RIVER NEAR SOBIESKI WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>ONEIDA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04074350"</Staid>
+ <Place_Name>WOLF RIVER NEAR NASHVILLE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>ONEIDA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04074420"</Staid>
+ <Place_Name>WOLF RIVER NEAR JENNINGS WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072013"</Staid>
+ <Place_Name>DUCK CREEK AT STINGE ROAD NEAR BLACK CREEK WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>3</Ammonia__wf>
+ <Nitrite__wf>3</Nitrite__wf>
+ <Ammonia___organic-N__w>3</Ammonia___organic-N__w>
+ <NH3_orgN__wu>3</NH3_orgN__wu>
+ <NO3_NO2__wf>3</NO3_NO2__wf>
+ <Phosphorus__wu>3</Phosphorus__wu>
+ <Phosphorus__wf>3</Phosphorus__wf>
+ <Orthophosphate__wf>3</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040720135"</Staid>
+ <Place_Name>UNNAMED DUCK CREEK TRIBUTARY NEAR BLACK CREEK WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>3</Ammonia__wf>
+ <Nitrite__wf>3</Nitrite__wf>
+ <Ammonia___organic-N__w>3</Ammonia___organic-N__w>
+ <NH3_orgN__wu>3</NH3_orgN__wu>
+ <NO3_NO2__wf>3</NO3_NO2__wf>
+ <Phosphorus__wu>3</Phosphorus__wu>
+ <Phosphorus__wf>3</Phosphorus__wf>
+ <Orthophosphate__wf>3</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072014"</Staid>
+ <Place_Name>DUCK CREEK AT CT HIGHWAY EE NEAR FIVE CORNERS WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072016"</Staid>
+ <Place_Name>DUCK CREEK AT MURPHY CORNER WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>3</Ammonia__wf>
+ <Nitrite__wf>3</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>3</NO3_NO2__wf>
+ <Phosphorus__wu>3</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>3</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>1</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>1</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072017"</Staid>
+ <Place_Name>UNNAMED DUCK CREEK TRIB AT CTH S NEAR FREEDOM WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072021"</Staid>
+ <Place_Name>DUCK CREEK TRIBUTARY NEAR MACKVILLE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072028"</Staid>
+ <Place_Name>DUCK CREEK AT CNTY TRUNK HIGHWAY S NR FREEDOM WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072031"</Staid>
+ <Place_Name>DUCK CREEK NEAR FREEDOM WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072038"</Staid>
+ <Place_Name>UNNAMED DUCK CREEK TRIBUTARY NEAR FREEDOM WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072040"</Staid>
+ <Place_Name>FISH CREEK NEAR ONEIDA WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040720445"</Staid>
+ <Place_Name>DUCK CREEK TRIBUTARY AT RANCH ROAD NEAR ONEIDA WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072050"</Staid>
+ <Place_Name>DUCK CREEK AT SEMINARY ROAD NEAR ONEIDA WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>cr</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>4</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04072050"</Staid>
+ <Place_Name>DUCK CREEK AT SEMINARY ROAD NEAR ONEIDA WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>cr</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>130</Ammonia__wf>
+ <Nitrite__wf>130</Nitrite__wf>
+ <Ammonia___organic-N__w>60</Ammonia___organic-N__w>
+ <NH3_orgN__wu>101</NH3_orgN__wu>
+ <NO3_NO2__wf>130</NO3_NO2__wf>
+ <Phosphorus__wu>129</Phosphorus__wu>
+ <Phosphorus__wf>60</Phosphorus__wf>
+ <Orthophosphate__wf>130</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>32</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>29</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04078042"</Staid>
+ <Place_Name>SHIOC RIVER NEAR NICHOLS WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04078085"</Staid>
+ <Place_Name>BLACK OTTER CREEK NEAR HORTONVILLE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04084429"</Staid>
+ <Place_Name>MUD CREEK AT SPENCER ROAD AT APPLETON WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>6</Ammonia__wf>
+ <Nitrite__wf>6</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>6</NO3_NO2__wf>
+ <Phosphorus__wu>6</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>6</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>6</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>6</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OUTAGAMIE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04084468"</Staid>
+ <Place_Name>GARNERS CREEK AT PARK STREET AT KAUKAUNA WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OZAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086500"</Staid>
+ <Place_Name>CEDAR CREEK NEAR CEDARBURG WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OZAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086600"</Staid>
+ <Place_Name>MILWAUKEE RIVER NEAR CEDARBURG WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>OZAUKEE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086699"</Staid>
+ <Place_Name>PIGEON CREEK AT WILLIAMSBURG DR AT THEINSVILLE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>PORTAGE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04080770"</Staid>
+ <Place_Name>TOMORROW RIVER @ STATE HIGHWAY 66 NEAR ROSHOLT WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>PORTAGE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04080785"</Staid>
+ <Place_Name>COLLINS LAKE OUTLET NEAR ROSHOLT WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>PORTAGE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04080786"</Staid>
+ <Place_Name>TOMORROW RIVER NEAR POLONIA WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>PORTAGE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04080789"</Staid>
+ <Place_Name>TOMORROW RIVER NEAR GARFIELD WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>PORTAGE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04080791"</Staid>
+ <Place_Name>TOMORROW RIVER @ HEMP FISHERY AREA NR GARFIELD WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf>1</Total_nitrogen__wf>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>PORTAGE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04080792"</Staid>
+ <Place_Name>PONCHO CREEK NEAR POLONIA WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>PORTAGE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04080798"</Staid>
+ <Place_Name>TOMORROW RIVER NEAR NELSONVILLE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>cr</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>3</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>PORTAGE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04080798"</Staid>
+ <Place_Name>TOMORROW RIVER NEAR NELSONVILLE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>cr</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>32</Ammonia__wf>
+ <Nitrite__wf>32</Nitrite__wf>
+ <Ammonia___organic-N__w>32</Ammonia___organic-N__w>
+ <NH3_orgN__wu>32</NH3_orgN__wu>
+ <NO3_NO2__wf>32</NO3_NO2__wf>
+ <Phosphorus__wu>32</Phosphorus__wu>
+ <Phosphorus__wf>32</Phosphorus__wf>
+ <Orthophosphate__wf>32</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>RACINE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040872325"</Staid>
+ <Place_Name>ROOT RIVER CANAL NEAR RAYMOND WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>RACINE</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040872393"</Staid>
+ <Place_Name>HOODS CREEK AT BROOK ROAD NEAR FRANKSVILLE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHAWANO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04071795"</Staid>
+ <Place_Name>PENSAUKEE RIVER NEAR KRAKOW WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>cr</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHAWANO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04071795"</Staid>
+ <Place_Name>PENSAUKEE RIVER NEAR KRAKOW WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>cr</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>34</Ammonia__wf>
+ <Nitrite__wf>34</Nitrite__wf>
+ <Ammonia___organic-N__w>34</Ammonia___organic-N__w>
+ <NH3_orgN__wu>34</NH3_orgN__wu>
+ <NO3_NO2__wf>34</NO3_NO2__wf>
+ <Phosphorus__wu>34</Phosphorus__wu>
+ <Phosphorus__wf>34</Phosphorus__wf>
+ <Orthophosphate__wf>34</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHAWANO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04077605"</Staid>
+ <Place_Name>WEST BRANCH RED RIVER NEAR BOWLER WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHAWANO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04077614"</Staid>
+ <Place_Name>SILVER CREEK AT SILVER CREEK ROAD NEAR BOWLER WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHAWANO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04077653"</Staid>
+ <Place_Name>SMITH CREEK NEAR BOWLER WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHAWANO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04078092"</Staid>
+ <Place_Name>MIDDLE BRANCH EMBARRASS RIVER NEAR ELAND WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>3</NH3_orgN__wu>
+ <NO3_NO2__wf>3</NO3_NO2__wf>
+ <Phosphorus__wu>3</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHAWANO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04078109"</Staid>
+ <Place_Name>SOUTH BR. EMBARRASS R AT CTH M NEAR WITTENBERG WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHAWANO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04078490"</Staid>
+ <Place_Name>MILL CREEK NEAR PELLA WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHEBOYGAN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040854945"</Staid>
+ <Place_Name>SHEBOYGAN RIVER NEAR ELKHART LAKE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHEBOYGAN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04085760"</Staid>
+ <Place_Name>MULLET RIVER NEAR PLYMOUTH WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHEBOYGAN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040860041"</Staid>
+ <Place_Name>SHEBOYGAN RIVER AT MOUTH AT SHEBOYGAN WI</Place_Name>
+ <Land_Use_Group>MIXED</Land_Use_Group>
+ <Land_Use_Code>mx</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>1</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHEBOYGAN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086156"</Staid>
+ <Place_Name>WATERCRESS CREEK NEAR DUNDEE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHEBOYGAN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086277"</Staid>
+ <Place_Name>NICHOLS CREEK NEAR CASCADE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>4</Ammonia__wf>
+ <Nitrite__wf>4</Nitrite__wf>
+ <Ammonia___organic-N__w>4</Ammonia___organic-N__w>
+ <NH3_orgN__wu>4</NH3_orgN__wu>
+ <NO3_NO2__wf>4</NO3_NO2__wf>
+ <Phosphorus__wu>4</Phosphorus__wu>
+ <Phosphorus__wf>4</Phosphorus__wf>
+ <Orthophosphate__wf>4</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHEBOYGAN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086284"</Staid>
+ <Place_Name>NORTH BRANCH MILWAUKEE RIVER TRIB NEAR CASCADE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHEBOYGAN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086289"</Staid>
+ <Place_Name>LAKE ELLEN OUTLET NEAR CASCADE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHEBOYGAN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086290"</Staid>
+ <Place_Name>NORTH BR MILWAUKEE RIVER AT CTH W NEAR CASCADE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHEBOYGAN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086292"</Staid>
+ <Place_Name>CHAMBERS CREEK NEAR CASCADE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHEBOYGAN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086296"</Staid>
+ <Place_Name>MELIUS CREEK NEAR CASCADE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHEBOYGAN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086297"</Staid>
+ <Place_Name>NORTH BRANCH MILWAUKEE RIVER NEAR BATAVIA WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>4</Ammonia__wf>
+ <Nitrite__wf>4</Nitrite__wf>
+ <Ammonia___organic-N__w>4</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>4</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>4</Phosphorus__wf>
+ <Orthophosphate__wf>4</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHEBOYGAN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086301"</Staid>
+ <Place_Name>GOOSEVILLE CREEK NEAR BATAVIA WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHEBOYGAN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086307"</Staid>
+ <Place_Name>BATAVIA CREEK NEAR BATAVIA WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHEBOYGAN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040863075"</Staid>
+ <Place_Name>NORTH BRANCH MILWAUKEE RIVER NEAR RANDOM LAKE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>cr</Land_Use_Code>
+ <Sample_Medium_Desc>BOTTOM MATERIAL</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_>3</Phosphorus__bs_62.5u_>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>SHEBOYGAN</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040863075"</Staid>
+ <Place_Name>NORTH BRANCH MILWAUKEE RIVER NEAR RANDOM LAKE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>cr</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>52</Ammonia__wf>
+ <Nitrite__wf>52</Nitrite__wf>
+ <Ammonia___organic-N__w>51</Ammonia___organic-N__w>
+ <NH3_orgN__wu>51</NH3_orgN__wu>
+ <NO3_NO2__wf>52</NO3_NO2__wf>
+ <Phosphorus__wu>51</Phosphorus__wu>
+ <Phosphorus__wf>51</Phosphorus__wf>
+ <Orthophosphate__wf>52</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WASHINGTON</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086326"</Staid>
+ <Place_Name>NORTH BR MILWAUKEE R @ HWY 84 NEAR RANDOM LAKE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WASHINGTON</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04086460"</Staid>
+ <Place_Name>CEDAR CREEK NEAR JACKSON WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WAUKESHA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04087030"</Staid>
+ <Place_Name>MENOMONEE RIVER AT MENOMONEE FALLS WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>5</Ammonia__wf>
+ <Nitrite__wf>5</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>5</NO3_NO2__wf>
+ <Phosphorus__wu>5</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>5</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>5</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>5</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WAUKESHA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="0408703164"</Staid>
+ <Place_Name>LILY CREEK AT GOOD HOPE ROAD NR MENOMONEE FALLS WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WAUKESHA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="040870856"</Staid>
+ <Place_Name>UNDERWOOD CR AT WATERTOWN PLANK RD @ ELM GROVE WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WAUKESHA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="055437901"</Staid>
+ <Place_Name>FOX RIVER AT RIVER ROAD NEAR SUSSEX WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>2</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>2</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WAUKESHA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="05543796"</Staid>
+ <Place_Name>POPLAR CREEK NEAR WAUKESHA WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf/>
+ <Phosphorus__wu/>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>1</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WAUPACA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04079000"</Staid>
+ <Place_Name>WOLF RIVER AT NEW LONDON WI</Place_Name>
+ <Land_Use_Group>MIXED</Land_Use_Group>
+ <Land_Use_Code>mx</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WAUPACA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04079657"</Staid>
+ <Place_Name>COMET CREEK NEAR BIG FALLS WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WAUPACA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04079790"</Staid>
+ <Place_Name>WHITCOMB CREEK NEAR BIG FALLS WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WAUPACA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04079840"</Staid>
+ <Place_Name>BLAKE CREEK AT SYMCO WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WAUPACA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04081100"</Staid>
+ <Place_Name>WALLA WALLA CREEK NEAR WEYAUWEGA WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WAUSHARA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04073200"</Staid>
+ <Place_Name>MECAN RIVER NEAR RICHFORD WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>1</Ammonia__wf>
+ <Nitrite__wf>1</Nitrite__wf>
+ <Ammonia___organic-N__w>1</Ammonia___organic-N__w>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf>1</Phosphorus__wf>
+ <Orthophosphate__wf>1</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WAUSHARA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04081407"</Staid>
+ <Place_Name>PINE RIVER AT WILD ROSE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WAUSHARA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04081412"</Staid>
+ <Place_Name>PINE RIVER NEAR SAXEVILLE WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WAUSHARA</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04081437"</Staid>
+ <Place_Name>WILLOW CREEK NEAR MOUNT MORRIS WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>fo</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WINNEBAGO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04081402"</Staid>
+ <Place_Name>ALDER CREEK NEAR FREMONT WI</Place_Name>
+ <Land_Use_Group>AG</Land_Use_Group>
+ <Land_Use_Code>ag</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf/>
+ <Nitrite__wf/>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu>1</NH3_orgN__wu>
+ <NO3_NO2__wf>1</NO3_NO2__wf>
+ <Phosphorus__wu>1</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf/>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WINNEBAGO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04081897"</Staid>
+ <Place_Name>SAWYER CREEK AT WESTHAVEN ROAD AT OSHKOSH WI</Place_Name>
+ <Land_Use_Group>OTHER</Land_Use_Group>
+ <Land_Use_Code>NA</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>6</Ammonia__wf>
+ <Nitrite__wf>6</Nitrite__wf>
+ <Ammonia___organic-N__w/>
+ <NH3_orgN__wu/>
+ <NO3_NO2__wf>6</NO3_NO2__wf>
+ <Phosphorus__wu>6</Phosphorus__wu>
+ <Phosphorus__wf/>
+ <Orthophosphate__wf>6</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend>6</Particulate-N__suspend>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu>6</Total_nitrogen__wu>
+</row><row>
+ <State_Postal_Code>WI</State_Postal_Code>
+ <State>WISCONSIN</State>
+ <County>WINNEBAGO</County>
+ <Suid>WMIC</Suid>
+ <Staid>="04082450"</Staid>
+ <Place_Name>FOX RIVER AT MAIN STREET BRIDGE AT OSHKOSH WI</Place_Name>
+ <Land_Use_Group>MIXED</Land_Use_Group>
+ <Land_Use_Code>mx</Land_Use_Code>
+ <Sample_Medium_Desc>SURFACE WATER</Sample_Medium_Desc>
+ <Ammonia__wf>2</Ammonia__wf>
+ <Nitrite__wf>2</Nitrite__wf>
+ <Ammonia___organic-N__w>2</Ammonia___organic-N__w>
+ <NH3_orgN__wu>2</NH3_orgN__wu>
+ <NO3_NO2__wf>2</NO3_NO2__wf>
+ <Phosphorus__wu>2</Phosphorus__wu>
+ <Phosphorus__wf>2</Phosphorus__wf>
+ <Orthophosphate__wf>2</Orthophosphate__wf>
+ <Phosphorus__bs_62.5u_/>
+ <Particulate-N__suspend/>
+ <Total_nitrogen__wf/>
+ <Total_nitrogen__wu/>
+</row>
\ No newline at end of file
=== added file 'test/ExpQueryResults/converters/csv/csv_parse11.xml.res'
--- test/ExpQueryResults/converters/csv/csv_parse11.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/converters/csv/csv_parse11.xml.res 2011-12-06 07:32:41 +0000
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<row>
+ <f1>f5</f1>
+ <_f2> f6</_f2>
+ <_f3> f7</_f3>
+ <_f4> f8
+"f9</_f4>
+ <_f10>f8</_f10>
+</row>
\ No newline at end of file
=== added file 'test/ExpQueryResults/converters/csv/csv_parse2.xml.res'
--- test/ExpQueryResults/converters/csv/csv_parse2.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/converters/csv/csv_parse2.xml.res 2011-12-06 07:32:41 +0000
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<row>
+ <column>f1</column>
+ <column> f2</column>
+ <column> f3</column>
+ <column> f4</column>
+</row><row>
+ <column>f5</column>
+ <column> f6</column>
+ <column> f7</column>
+ <column> f8
+"f9</column>
+</row>
\ No newline at end of file
=== added file 'test/ExpQueryResults/converters/csv/csv_parse3.xml.res'
--- test/ExpQueryResults/converters/csv/csv_parse3.xml.res 1970-01-01 00:00:00 +0000
+++ test/ExpQueryResults/converters/csv/csv_parse3.xml.res 2011-12-06 07:32:41 +0000
@@ -0,0 +1,4501 @@
+<row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03840NVLRNOCEAN</TRI_Facility_ID>
+ <Facility_Name>NOVEL IRON WORKS INC</Facility_Name>
+ <Street_Address>250 OCEAN RD</Street_Address>
+ <City>GREENLAND</City>
+ <County>ROCKINGHAM</County>
+ <ST>NH</ST>
+ <ZIP>03840</ZIP>
+ <Latitude>43.0427</Latitude>
+ <Longitude>-70.817833</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>332312</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206215129</Doc_Ctrl_Num>
+ <Chemical>MANGANESE</Chemical>
+ <CAS___Compound_ID>007439965</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>YES</Metal>
+ <Metal_Category>1</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>A</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>0</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>0</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>0</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>0</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>0</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>0</_8.9_Production_Ratio>
+ <Parent_Company_Name>NA</Parent_Company_Name>
+ <Parent_Company_DB_Number>NA</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03055SNTGB47POW</TRI_Facility_ID>
+ <Facility_Name>SAINT-GOBAIN CERAMICS- IGNITER PRODUCTS</Facility_Name>
+ <Street_Address>47 POWERS ST</Street_Address>
+ <City>MILFORD</City>
+ <County>HILLSBOROUGH</County>
+ <ST>NH</ST>
+ <ZIP>03055</ZIP>
+ <Latitude>42.827745</Latitude>
+ <Longitude>-71.6376</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>335228</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206688160</Doc_Ctrl_Num>
+ <Chemical>NICKEL</Chemical>
+ <CAS___Compound_ID>007440020</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>YES</Metal>
+ <Metal_Category>1</Metal_Category>
+ <Carcinogen>YES</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>0</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>0</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>31000</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>31000</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>0</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>0</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>29000</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>29000</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.89</_8.9_Production_Ratio>
+ <Parent_Company_Name>SAINT-GOBAIN CORP</Parent_Company_Name>
+ <Parent_Company_DB_Number>NA</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03055SNTGB47POW</TRI_Facility_ID>
+ <Facility_Name>SAINT-GOBAIN CERAMICS- IGNITER PRODUCTS</Facility_Name>
+ <Street_Address>47 POWERS ST</Street_Address>
+ <City>MILFORD</City>
+ <County>HILLSBOROUGH</County>
+ <ST>NH</ST>
+ <ZIP>03055</ZIP>
+ <Latitude>42.827745</Latitude>
+ <Longitude>-71.6376</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>335228</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206688172</Doc_Ctrl_Num>
+ <Chemical>LEAD</Chemical>
+ <CAS___Compound_ID>007439921</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>YES</Metal>
+ <Metal_Category>1</Metal_Category>
+ <Carcinogen>YES</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>0</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>0</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>500</_6.2_M93>
+ <Off-Site_Recycled_Total>500</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>0</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>0</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>500</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>500</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio/>
+ <Parent_Company_Name>SAINT-GOBAIN CORP</Parent_Company_Name>
+ <Parent_Company_DB_Number>NA</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03304PBLCS97RIV</TRI_Facility_ID>
+ <Facility_Name>MERRIMACK STATION</Facility_Name>
+ <Street_Address>97 RIVER RD</Street_Address>
+ <City>BOW</City>
+ <County>MERRIMACK</County>
+ <ST>NH</ST>
+ <ZIP>03304</ZIP>
+ <Latitude>43.140833</Latitude>
+ <Longitude>-71.467778</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206911339</Doc_Ctrl_Num>
+ <Chemical>ZINC COMPOUNDS</Chemical>
+ <CAS___Compound_ID>N982</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>NO</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>YES</Metal>
+ <Metal_Category>1</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>30</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>79</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>3000</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>3000</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>3109</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>12120.2</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>12120.2</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>15229.2</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>3109</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>12120.2</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>15229.2</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.87</_8.9_Production_Ratio>
+ <Parent_Company_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE</Parent_Company_Name>
+ <Parent_Company_DB_Number>103801387</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03304PBLCS97RIV</TRI_Facility_ID>
+ <Facility_Name>MERRIMACK STATION</Facility_Name>
+ <Street_Address>97 RIVER RD</Street_Address>
+ <City>BOW</City>
+ <County>MERRIMACK</County>
+ <ST>NH</ST>
+ <ZIP>03304</ZIP>
+ <Latitude>43.140833</Latitude>
+ <Longitude>-71.467778</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206911327</Doc_Ctrl_Num>
+ <Chemical>VANADIUM COMPOUNDS</Chemical>
+ <CAS___Compound_ID>N770</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>NO</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>YES</Metal>
+ <Metal_Category>1</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>109</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>4000</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>4000</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>4109</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>16530.3</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>16530.3</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>20639.3</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>4109</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>16530.3</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>20639.3</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.87</_8.9_Production_Ratio>
+ <Parent_Company_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE</Parent_Company_Name>
+ <Parent_Company_DB_Number>103801387</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03304PBLCS97RIV</TRI_Facility_ID>
+ <Facility_Name>MERRIMACK STATION</Facility_Name>
+ <Street_Address>97 RIVER RD</Street_Address>
+ <City>BOW</City>
+ <County>MERRIMACK</County>
+ <ST>NH</ST>
+ <ZIP>03304</ZIP>
+ <Latitude>43.140833</Latitude>
+ <Longitude>-71.467778</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206911303</Doc_Ctrl_Num>
+ <Chemical>POLYCYCLIC AROMATIC COMPOUNDS</Chemical>
+ <CAS___Compound_ID>N590</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>YES</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>1.3</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>1.3</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>1.3</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>1.3</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>1.3</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.87</_8.9_Production_Ratio>
+ <Parent_Company_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE</Parent_Company_Name>
+ <Parent_Company_DB_Number>103801387</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03304PBLCS97RIV</TRI_Facility_ID>
+ <Facility_Name>MERRIMACK STATION</Facility_Name>
+ <Street_Address>97 RIVER RD</Street_Address>
+ <City>BOW</City>
+ <County>MERRIMACK</County>
+ <ST>NH</ST>
+ <ZIP>03304</ZIP>
+ <Latitude>43.140833</Latitude>
+ <Longitude>-71.467778</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206911291</Doc_Ctrl_Num>
+ <Chemical>NICKEL COMPOUNDS</Chemical>
+ <CAS___Compound_ID>N495</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>YES</Metal>
+ <Metal_Category>1</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>8</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>49</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>1800</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>1800</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>1857</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>7340.4</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>7340.4</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>9197.4</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>1857</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>7340.4</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>9197.4</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.87</_8.9_Production_Ratio>
+ <Parent_Company_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE</Parent_Company_Name>
+ <Parent_Company_DB_Number>103801387</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03304PBLCS97RIV</TRI_Facility_ID>
+ <Facility_Name>MERRIMACK STATION</Facility_Name>
+ <Street_Address>97 RIVER RD</Street_Address>
+ <City>BOW</City>
+ <County>MERRIMACK</County>
+ <ST>NH</ST>
+ <ZIP>03304</ZIP>
+ <Latitude>43.140833</Latitude>
+ <Longitude>-71.467778</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206911289</Doc_Ctrl_Num>
+ <Chemical>MERCURY COMPOUNDS</Chemical>
+ <CAS___Compound_ID>N458</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>PBT</Classification>
+ <Metal>YES</Metal>
+ <Metal_Category>1</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>160</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>8</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>8</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>168</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>31.4</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>31.4</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>199.4</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>168</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>31.4</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>199.4</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.87</_8.9_Production_Ratio>
+ <Parent_Company_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE</Parent_Company_Name>
+ <Parent_Company_DB_Number>103801387</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03304PBLCS97RIV</TRI_Facility_ID>
+ <Facility_Name>MERRIMACK STATION</Facility_Name>
+ <Street_Address>97 RIVER RD</Street_Address>
+ <City>BOW</City>
+ <County>MERRIMACK</County>
+ <ST>NH</ST>
+ <ZIP>03304</ZIP>
+ <Latitude>43.140833</Latitude>
+ <Longitude>-71.467778</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206911277</Doc_Ctrl_Num>
+ <Chemical>MANGANESE COMPOUNDS</Chemical>
+ <CAS___Compound_ID>N450</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>YES</Metal>
+ <Metal_Category>1</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>8</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>140</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>5100</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>5100</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>5248</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>20740.4</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>20740.4</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>25988.4</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>5248</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>20740.4</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>25988.4</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.87</_8.9_Production_Ratio>
+ <Parent_Company_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE</Parent_Company_Name>
+ <Parent_Company_DB_Number>103801387</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03304PBLCS97RIV</TRI_Facility_ID>
+ <Facility_Name>MERRIMACK STATION</Facility_Name>
+ <Street_Address>97 RIVER RD</Street_Address>
+ <City>BOW</City>
+ <County>MERRIMACK</County>
+ <ST>NH</ST>
+ <ZIP>03304</ZIP>
+ <Latitude>43.140833</Latitude>
+ <Longitude>-71.467778</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206911265</Doc_Ctrl_Num>
+ <Chemical>LEAD COMPOUNDS</Chemical>
+ <CAS___Compound_ID>N420</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>PBT</Classification>
+ <Metal>YES</Metal>
+ <Metal_Category>1</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>1</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>12</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>450</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>450</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>463</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>1838.38</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>1838.38</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>2301.38</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>463</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>1838.38</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>2301.38</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.87</_8.9_Production_Ratio>
+ <Parent_Company_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE</Parent_Company_Name>
+ <Parent_Company_DB_Number>103801387</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03304PBLCS97RIV</TRI_Facility_ID>
+ <Facility_Name>MERRIMACK STATION</Facility_Name>
+ <Street_Address>97 RIVER RD</Street_Address>
+ <City>BOW</City>
+ <County>MERRIMACK</County>
+ <ST>NH</ST>
+ <ZIP>03304</ZIP>
+ <Latitude>43.140833</Latitude>
+ <Longitude>-71.467778</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206911238</Doc_Ctrl_Num>
+ <Chemical>DIOXIN AND DIOXIN-LIKE COMPOUNDS</Chemical>
+ <CAS___Compound_ID>N150</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>DIOXIN</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Grams</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>.2332</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>.2332</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>.2332</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>.23</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>.23</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.87</_8.9_Production_Ratio>
+ <Parent_Company_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE</Parent_Company_Name>
+ <Parent_Company_DB_Number>103801387</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03304PBLCS97RIV</TRI_Facility_ID>
+ <Facility_Name>MERRIMACK STATION</Facility_Name>
+ <Street_Address>97 RIVER RD</Street_Address>
+ <City>BOW</City>
+ <County>MERRIMACK</County>
+ <ST>NH</ST>
+ <ZIP>03304</ZIP>
+ <Latitude>43.140833</Latitude>
+ <Longitude>-71.467778</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206911226</Doc_Ctrl_Num>
+ <Chemical>CHROMIUM COMPOUNDS(EXCEPT CHROMITE ORE MINED IN THE TRANSVAAL REGION)</Chemical>
+ <CAS___Compound_ID>N090</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>YES</Metal>
+ <Metal_Category>1</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>74</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>2800</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>2800</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>2874</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>11350.5</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>11350.5</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>14224.5</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>2874</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>11350.5</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>14224.5</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.87</_8.9_Production_Ratio>
+ <Parent_Company_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE</Parent_Company_Name>
+ <Parent_Company_DB_Number>103801387</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03304PBLCS97RIV</TRI_Facility_ID>
+ <Facility_Name>MERRIMACK STATION</Facility_Name>
+ <Street_Address>97 RIVER RD</Street_Address>
+ <City>BOW</City>
+ <County>MERRIMACK</County>
+ <ST>NH</ST>
+ <ZIP>03304</ZIP>
+ <Latitude>43.140833</Latitude>
+ <Longitude>-71.467778</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206911202</Doc_Ctrl_Num>
+ <Chemical>BARIUM COMPOUNDS</Chemical>
+ <CAS___Compound_ID>N040</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>NO</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>YES</Metal>
+ <Metal_Category>3</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>1</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>370</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>13000</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>13000</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>13371</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>51400</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>51400</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>64771</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>13371</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>51400</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>64771</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.87</_8.9_Production_Ratio>
+ <Parent_Company_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE</Parent_Company_Name>
+ <Parent_Company_DB_Number>103801387</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03304PBLCS97RIV</TRI_Facility_ID>
+ <Facility_Name>MERRIMACK STATION</Facility_Name>
+ <Street_Address>97 RIVER RD</Street_Address>
+ <City>BOW</City>
+ <County>MERRIMACK</County>
+ <ST>NH</ST>
+ <ZIP>03304</ZIP>
+ <Latitude>43.140833</Latitude>
+ <Longitude>-71.467778</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206911315</Doc_Ctrl_Num>
+ <Chemical>SULFURIC ACID (1994 AND AFTER "ACID AEROSOLS" ONLY)</Chemical>
+ <CAS___Compound_ID>007664939</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>NO</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>430000</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>430000</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>430000</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>430000</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>430000</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.87</_8.9_Production_Ratio>
+ <Parent_Company_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE</Parent_Company_Name>
+ <Parent_Company_DB_Number>103801387</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03304PBLCS97RIV</TRI_Facility_ID>
+ <Facility_Name>MERRIMACK STATION</Facility_Name>
+ <Street_Address>97 RIVER RD</Street_Address>
+ <City>BOW</City>
+ <County>MERRIMACK</County>
+ <ST>NH</ST>
+ <ZIP>03304</ZIP>
+ <Latitude>43.140833</Latitude>
+ <Longitude>-71.467778</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206911190</Doc_Ctrl_Num>
+ <Chemical>AMMONIA</Chemical>
+ <CAS___Compound_ID>007664417</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>NO</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>1500</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>1500</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>1500</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>1500</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>1500</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.87</_8.9_Production_Ratio>
+ <Parent_Company_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE</Parent_Company_Name>
+ <Parent_Company_DB_Number>103801387</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03304PBLCS97RIV</TRI_Facility_ID>
+ <Facility_Name>MERRIMACK STATION</Facility_Name>
+ <Street_Address>97 RIVER RD</Street_Address>
+ <City>BOW</City>
+ <County>MERRIMACK</County>
+ <ST>NH</ST>
+ <ZIP>03304</ZIP>
+ <Latitude>43.140833</Latitude>
+ <Longitude>-71.467778</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206911253</Doc_Ctrl_Num>
+ <Chemical>HYDROGEN FLUORIDE</Chemical>
+ <CAS___Compound_ID>007664393</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>170000</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>170000</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>170000</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>170000</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>170000</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.87</_8.9_Production_Ratio>
+ <Parent_Company_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE</Parent_Company_Name>
+ <Parent_Company_DB_Number>103801387</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03304PBLCS97RIV</TRI_Facility_ID>
+ <Facility_Name>MERRIMACK STATION</Facility_Name>
+ <Street_Address>97 RIVER RD</Street_Address>
+ <City>BOW</City>
+ <County>MERRIMACK</County>
+ <ST>NH</ST>
+ <ZIP>03304</ZIP>
+ <Latitude>43.140833</Latitude>
+ <Longitude>-71.467778</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206911240</Doc_Ctrl_Num>
+ <Chemical>HYDROCHLORIC ACID (1995 AND AFTER "ACID AEROSOLS" ONLY)</Chemical>
+ <CAS___Compound_ID>007647010</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>1600000</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>1600000</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>1600000</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>1600000</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>1600000</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.87</_8.9_Production_Ratio>
+ <Parent_Company_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE</Parent_Company_Name>
+ <Parent_Company_DB_Number>103801387</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03304PBLCS97RIV</TRI_Facility_ID>
+ <Facility_Name>MERRIMACK STATION</Facility_Name>
+ <Street_Address>97 RIVER RD</Street_Address>
+ <City>BOW</City>
+ <County>MERRIMACK</County>
+ <ST>NH</ST>
+ <ZIP>03304</ZIP>
+ <Latitude>43.140833</Latitude>
+ <Longitude>-71.467778</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206911214</Doc_Ctrl_Num>
+ <Chemical>BENZO(G,H,I)PERYLENE</Chemical>
+ <CAS___Compound_ID>000191242</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>YES</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>0</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>0</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>0</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>0</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>0</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.87</_8.9_Production_Ratio>
+ <Parent_Company_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE</Parent_Company_Name>
+ <Parent_Company_DB_Number>103801387</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03054NHSRB221DA</TRI_Facility_ID>
+ <Facility_Name>ANHEUSER-BUSCH INC</Facility_Name>
+ <Street_Address>221 DANIEL WEBSTER HWY</Street_Address>
+ <City>MERRIMACK</City>
+ <County>HILLSBOROUGH</County>
+ <ST>NH</ST>
+ <ZIP>030544807</ZIP>
+ <Latitude>42.824167</Latitude>
+ <Longitude>-71.484167</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>312120</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206816858</Doc_Ctrl_Num>
+ <Chemical>POLYCYCLIC AROMATIC COMPOUNDS</Chemical>
+ <CAS___Compound_ID>N590</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>YES</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>0</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>0</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>0</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>0</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>0</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>1.01</_8.9_Production_Ratio>
+ <Parent_Company_Name>ANHEUSER-BUSCH COS INC.</Parent_Company_Name>
+ <Parent_Company_DB_Number>098630254</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03054NHSRB221DA</TRI_Facility_ID>
+ <Facility_Name>ANHEUSER-BUSCH INC</Facility_Name>
+ <Street_Address>221 DANIEL WEBSTER HWY</Street_Address>
+ <City>MERRIMACK</City>
+ <County>HILLSBOROUGH</County>
+ <ST>NH</ST>
+ <ZIP>030544807</ZIP>
+ <Latitude>42.824167</Latitude>
+ <Longitude>-71.484167</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>312120</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206816833</Doc_Ctrl_Num>
+ <Chemical>AMMONIA</Chemical>
+ <CAS___Compound_ID>007664417</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>NO</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>13868</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>1</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>13869</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>579</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>579</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>2</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>2</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>1</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>1</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>13871</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>13869</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>2</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>1</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>217</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>579</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>14668</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>1.01</_8.9_Production_Ratio>
+ <Parent_Company_Name>ANHEUSER-BUSCH COS INC.</Parent_Company_Name>
+ <Parent_Company_DB_Number>098630254</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03054NHSRB221DA</TRI_Facility_ID>
+ <Facility_Name>ANHEUSER-BUSCH INC</Facility_Name>
+ <Street_Address>221 DANIEL WEBSTER HWY</Street_Address>
+ <City>MERRIMACK</City>
+ <County>HILLSBOROUGH</County>
+ <ST>NH</ST>
+ <ZIP>030544807</ZIP>
+ <Latitude>42.824167</Latitude>
+ <Longitude>-71.484167</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>312120</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206816845</Doc_Ctrl_Num>
+ <Chemical>BENZO(G,H,I)PERYLENE</Chemical>
+ <CAS___Compound_ID>000191242</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>YES</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>0</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>0</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>0</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>0</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>0</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>1.01</_8.9_Production_Ratio>
+ <Parent_Company_Name>ANHEUSER-BUSCH COS INC.</Parent_Company_Name>
+ <Parent_Company_DB_Number>098630254</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03054NSHCR57DAN</TRI_Facility_ID>
+ <Facility_Name>NASHUA CORP</Facility_Name>
+ <Street_Address>59 DANIEL WEBSTER HWY</Street_Address>
+ <City>MERRIMACK</City>
+ <County>HILLSBOROUGH</County>
+ <ST>NH</ST>
+ <ZIP>03054</ZIP>
+ <Latitude>42.803333</Latitude>
+ <Longitude>-71.473333</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>322222</Primary_NAICS>
+ <NAICS_2>325510</NAICS_2>
+ <NAICS_3>325211</NAICS_3>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206732339</Doc_Ctrl_Num>
+ <Chemical>ZINC COMPOUNDS</Chemical>
+ <CAS___Compound_ID>N982</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>NO</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>YES</Metal>
+ <Metal_Category>1</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>0</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>0</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>250</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>250</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>250</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>250</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>500</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>0</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>500</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>500</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>1</_8.9_Production_Ratio>
+ <Parent_Company_Name>NASHUA CORP</Parent_Company_Name>
+ <Parent_Company_DB_Number>001079433</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03054NSHCR57DAN</TRI_Facility_ID>
+ <Facility_Name>NASHUA CORP</Facility_Name>
+ <Street_Address>59 DANIEL WEBSTER HWY</Street_Address>
+ <City>MERRIMACK</City>
+ <County>HILLSBOROUGH</County>
+ <ST>NH</ST>
+ <ZIP>03054</ZIP>
+ <Latitude>42.803333</Latitude>
+ <Longitude>-71.473333</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>322222</Primary_NAICS>
+ <NAICS_2>325510</NAICS_2>
+ <NAICS_3>325211</NAICS_3>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206732291</Doc_Ctrl_Num>
+ <Chemical>POLYCYCLIC AROMATIC COMPOUNDS</Chemical>
+ <CAS___Compound_ID>N590</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>YES</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>0</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>0</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>0</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>0</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>0</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.45</_8.9_Production_Ratio>
+ <Parent_Company_Name>NASHUA CORP</Parent_Company_Name>
+ <Parent_Company_DB_Number>001079433</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03054NSHCR57DAN</TRI_Facility_ID>
+ <Facility_Name>NASHUA CORP</Facility_Name>
+ <Street_Address>59 DANIEL WEBSTER HWY</Street_Address>
+ <City>MERRIMACK</City>
+ <County>HILLSBOROUGH</County>
+ <ST>NH</ST>
+ <ZIP>03054</ZIP>
+ <Latitude>42.803333</Latitude>
+ <Longitude>-71.473333</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>322222</Primary_NAICS>
+ <NAICS_2>325510</NAICS_2>
+ <NAICS_3>325211</NAICS_3>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206732327</Doc_Ctrl_Num>
+ <Chemical>VINYL ACETATE</Chemical>
+ <CAS___Compound_ID>000108054</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>YES</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>14</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>116</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>130</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>130</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>130</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>1920</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>2050</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.65</_8.9_Production_Ratio>
+ <Parent_Company_Name>NASHUA CORP</Parent_Company_Name>
+ <Parent_Company_DB_Number>001079433</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03054NSHCR57DAN</TRI_Facility_ID>
+ <Facility_Name>NASHUA CORP</Facility_Name>
+ <Street_Address>59 DANIEL WEBSTER HWY</Street_Address>
+ <City>MERRIMACK</City>
+ <County>HILLSBOROUGH</County>
+ <ST>NH</ST>
+ <ZIP>03054</ZIP>
+ <Latitude>42.803333</Latitude>
+ <Longitude>-71.473333</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>322222</Primary_NAICS>
+ <NAICS_2>325510</NAICS_2>
+ <NAICS_3>325211</NAICS_3>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206732303</Doc_Ctrl_Num>
+ <Chemical>STYRENE</Chemical>
+ <CAS___Compound_ID>000100425</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>YES</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>3494</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>1294</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>4788</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>5</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>5</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>4788</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>4788</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>82</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>5</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>4875</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.9</_8.9_Production_Ratio>
+ <Parent_Company_Name>NASHUA CORP</Parent_Company_Name>
+ <Parent_Company_DB_Number>001079433</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03054NSHCR57DAN</TRI_Facility_ID>
+ <Facility_Name>NASHUA CORP</Facility_Name>
+ <Street_Address>59 DANIEL WEBSTER HWY</Street_Address>
+ <City>MERRIMACK</City>
+ <County>HILLSBOROUGH</County>
+ <ST>NH</ST>
+ <ZIP>03054</ZIP>
+ <Latitude>42.803333</Latitude>
+ <Longitude>-71.473333</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>322222</Primary_NAICS>
+ <NAICS_2>325510</NAICS_2>
+ <NAICS_3>325211</NAICS_3>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206732240</Doc_Ctrl_Num>
+ <Chemical>BENZOYL PEROXIDE</Chemical>
+ <CAS___Compound_ID>000094360</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>NO</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>0</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>0</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>5</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>5</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>5</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>0</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>5</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>5</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.8</_8.9_Production_Ratio>
+ <Parent_Company_Name>NASHUA CORP</Parent_Company_Name>
+ <Parent_Company_DB_Number>001079433</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03054NSHCR57DAN</TRI_Facility_ID>
+ <Facility_Name>NASHUA CORP</Facility_Name>
+ <Street_Address>59 DANIEL WEBSTER HWY</Street_Address>
+ <City>MERRIMACK</City>
+ <County>HILLSBOROUGH</County>
+ <ST>NH</ST>
+ <ZIP>03054</ZIP>
+ <Latitude>42.803333</Latitude>
+ <Longitude>-71.473333</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>322222</Primary_NAICS>
+ <NAICS_2>325510</NAICS_2>
+ <NAICS_3>325211</NAICS_3>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206732289</Doc_Ctrl_Num>
+ <Chemical>PHTHALIC ANHYDRIDE</Chemical>
+ <CAS___Compound_ID>000085449</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>5</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>0</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>5</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>5</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>5</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>10</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>5</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>5</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>10</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.65</_8.9_Production_Ratio>
+ <Parent_Company_Name>NASHUA CORP</Parent_Company_Name>
+ <Parent_Company_DB_Number>001079433</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03054NSHCR57DAN</TRI_Facility_ID>
+ <Facility_Name>NASHUA CORP</Facility_Name>
+ <Street_Address>59 DANIEL WEBSTER HWY</Street_Address>
+ <City>MERRIMACK</City>
+ <County>HILLSBOROUGH</County>
+ <ST>NH</ST>
+ <ZIP>03054</ZIP>
+ <Latitude>42.803333</Latitude>
+ <Longitude>-71.473333</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>322222</Primary_NAICS>
+ <NAICS_2>325510</NAICS_2>
+ <NAICS_3>325211</NAICS_3>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206732253</Doc_Ctrl_Num>
+ <Chemical>BENZO(G,H,I)PERYLENE</Chemical>
+ <CAS___Compound_ID>000191242</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>YES</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>0</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>0</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>0</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>0</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>0</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.2</_8.9_Production_Ratio>
+ <Parent_Company_Name>NASHUA CORP</Parent_Company_Name>
+ <Parent_Company_DB_Number>001079433</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03054NSHCR57DAN</TRI_Facility_ID>
+ <Facility_Name>NASHUA CORP</Facility_Name>
+ <Street_Address>59 DANIEL WEBSTER HWY</Street_Address>
+ <City>MERRIMACK</City>
+ <County>HILLSBOROUGH</County>
+ <ST>NH</ST>
+ <ZIP>03054</ZIP>
+ <Latitude>42.803333</Latitude>
+ <Longitude>-71.473333</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>322222</Primary_NAICS>
+ <NAICS_2>325510</NAICS_2>
+ <NAICS_3>325211</NAICS_3>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206732265</Doc_Ctrl_Num>
+ <Chemical>BUTYL ACRYLATE</Chemical>
+ <CAS___Compound_ID>000141322</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>NO</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>255</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>45</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>300</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>5</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>5</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>300</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>300</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>28</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>5</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>333</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.8</_8.9_Production_Ratio>
+ <Parent_Company_Name>NASHUA CORP</Parent_Company_Name>
+ <Parent_Company_DB_Number>001079433</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03054NSHCR57DAN</TRI_Facility_ID>
+ <Facility_Name>NASHUA CORP</Facility_Name>
+ <Street_Address>59 DANIEL WEBSTER HWY</Street_Address>
+ <City>MERRIMACK</City>
+ <County>HILLSBOROUGH</County>
+ <ST>NH</ST>
+ <ZIP>03054</ZIP>
+ <Latitude>42.803333</Latitude>
+ <Longitude>-71.473333</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>322222</Primary_NAICS>
+ <NAICS_2>325510</NAICS_2>
+ <NAICS_3>325211</NAICS_3>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206732277</Doc_Ctrl_Num>
+ <Chemical>CYCLOHEXANOL</Chemical>
+ <CAS___Compound_ID>000108930</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>NO</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>5</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>523</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>528</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>40</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>40</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>505</_6.2_M95>
+ <Off-Site_Treated_Total>505</Off-Site_Treated_Total>
+ <Total_Releases>528</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>528</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>545</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>1073</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.65</_8.9_Production_Ratio>
+ <Parent_Company_Name>NASHUA CORP</Parent_Company_Name>
+ <Parent_Company_DB_Number>001079433</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03054NSHCR57DAN</TRI_Facility_ID>
+ <Facility_Name>NASHUA CORP</Facility_Name>
+ <Street_Address>59 DANIEL WEBSTER HWY</Street_Address>
+ <City>MERRIMACK</City>
+ <County>HILLSBOROUGH</County>
+ <ST>NH</ST>
+ <ZIP>03054</ZIP>
+ <Latitude>42.803333</Latitude>
+ <Longitude>-71.473333</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>322222</Primary_NAICS>
+ <NAICS_2>325510</NAICS_2>
+ <NAICS_3>325211</NAICS_3>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206732315</Doc_Ctrl_Num>
+ <Chemical>TOLUENE</Chemical>
+ <CAS___Compound_ID>000108883</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>899</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>21582</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>22481</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>5</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>5</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>3840.2</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>3840.2</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>504.5</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>497</_6.2_M95>
+ <Off-Site_Treated_Total>1001.5</Off-Site_Treated_Total>
+ <Total_Releases>22481</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>22481</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>3840.2</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>461123</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>1300</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>1006.5</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>489750.7</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.7</_8.9_Production_Ratio>
+ <Parent_Company_Name>NASHUA CORP</Parent_Company_Name>
+ <Parent_Company_DB_Number>001079433</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03801GLDBNFREEM</TRI_Facility_ID>
+ <Facility_Name>NEW NGC INC D/B/A NATIONAL GYPSUM CO</Facility_Name>
+ <Street_Address>MICHAEL J SUCCI DR</Street_Address>
+ <City>PORTSMOUTH</City>
+ <County>ROCKINGHAM</County>
+ <ST>NH</ST>
+ <ZIP>03802</ZIP>
+ <Latitude>43.087778</Latitude>
+ <Longitude>-70.763889</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>327420</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206304863</Doc_Ctrl_Num>
+ <Chemical>LEAD COMPOUNDS</Chemical>
+ <CAS___Compound_ID>N420</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>PBT</Classification>
+ <Metal>YES</Metal>
+ <Metal_Category>1</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>.5</_5.2_Stack_Air>
+ <_5.3_Water>.1</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>.6</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>.6</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>.6</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>.1</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>.7</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>1</_8.9_Production_Ratio>
+ <Parent_Company_Name>NEW NGC INC.</Parent_Company_Name>
+ <Parent_Company_DB_Number>808836894</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03833GTPRDPORTS</TRI_Facility_ID>
+ <Facility_Name>OSRAM SYLVANIA PRODUCTS INC</Facility_Name>
+ <Street_Address>131 PORTSMOUTH AVE</Street_Address>
+ <City>EXETER</City>
+ <County>ROCKINGHAM</County>
+ <ST>NH</ST>
+ <ZIP>03833</ZIP>
+ <Latitude>42.986667</Latitude>
+ <Longitude>-70.929444</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>327212</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206531042</Doc_Ctrl_Num>
+ <Chemical>POLYCYCLIC AROMATIC COMPOUNDS</Chemical>
+ <CAS___Compound_ID>N590</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>YES</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>0</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>0</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>0</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>0</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>0</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.57</_8.9_Production_Ratio>
+ <Parent_Company_Name>SIEMENS CORP</Parent_Company_Name>
+ <Parent_Company_DB_Number>001495928</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03833GTPRDPORTS</TRI_Facility_ID>
+ <Facility_Name>OSRAM SYLVANIA PRODUCTS INC</Facility_Name>
+ <Street_Address>131 PORTSMOUTH AVE</Street_Address>
+ <City>EXETER</City>
+ <County>ROCKINGHAM</County>
+ <ST>NH</ST>
+ <ZIP>03833</ZIP>
+ <Latitude>42.986667</Latitude>
+ <Longitude>-70.929444</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>327212</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206531030</Doc_Ctrl_Num>
+ <Chemical>HYDROGEN FLUORIDE</Chemical>
+ <CAS___Compound_ID>007664393</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>37</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>37</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>153847</_6.2_M95>
+ <Off-Site_Treated_Total>153847</Off-Site_Treated_Total>
+ <Total_Releases>37</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>37</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>14479</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>153847</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>168363</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.56</_8.9_Production_Ratio>
+ <Parent_Company_Name>SIEMENS CORP</Parent_Company_Name>
+ <Parent_Company_DB_Number>001495928</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03833GTPRDPORTS</TRI_Facility_ID>
+ <Facility_Name>OSRAM SYLVANIA PRODUCTS INC</Facility_Name>
+ <Street_Address>131 PORTSMOUTH AVE</Street_Address>
+ <City>EXETER</City>
+ <County>ROCKINGHAM</County>
+ <ST>NH</ST>
+ <ZIP>03833</ZIP>
+ <Latitude>42.986667</Latitude>
+ <Longitude>-70.929444</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>327212</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206531028</Doc_Ctrl_Num>
+ <Chemical>BENZO(G,H,I)PERYLENE</Chemical>
+ <CAS___Compound_ID>000191242</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>YES</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>0</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>0</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>0</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>0</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>0</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.57</_8.9_Production_Ratio>
+ <Parent_Company_Name>SIEMENS CORP</Parent_Company_Name>
+ <Parent_Company_DB_Number>001495928</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03801CNDNW99OLD</TRI_Facility_ID>
+ <Facility_Name>NAEA NEWINGTON ENERGY LLC</Facility_Name>
+ <Street_Address>200 SHATTUCK WAY</Street_Address>
+ <City>NEWINGTON</City>
+ <County>ROCKINGHAM</County>
+ <ST>NH</ST>
+ <ZIP>03801</ZIP>
+ <Latitude>43.105</Latitude>
+ <Longitude>-70.806944</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206284818</Doc_Ctrl_Num>
+ <Chemical>AMMONIA</Chemical>
+ <CAS___Compound_ID>007664417</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>NO</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>5</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>16619.465</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>16624.465</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>4.36</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>4.36</Off-Site_Treated_Total>
+ <Total_Releases>16624.465</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>16624.465</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>0</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>4.36</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>16628.825</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.85</_8.9_Production_Ratio>
+ <Parent_Company_Name>NORTH AMERICAN ENERGY ALLIACNE LLC</Parent_Company_Name>
+ <Parent_Company_DB_Number>NA</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03801NWNGT165GO</TRI_Facility_ID>
+ <Facility_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE NEWINGTON STATION</Facility_Name>
+ <Street_Address>165 GOSLING RD</Street_Address>
+ <City>NEWINGTON</City>
+ <County>ROCKINGHAM</County>
+ <ST>NH</ST>
+ <ZIP>03801</ZIP>
+ <Latitude>43.105</Latitude>
+ <Longitude>-70.806944</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206796575</Doc_Ctrl_Num>
+ <Chemical>VANADIUM COMPOUNDS</Chemical>
+ <CAS___Compound_ID>N770</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>NO</Clean_Air_Act_Chemical>
+ <Classification>NON-PBT</Classification>
+ <Metal>YES</Metal>
+ <Metal_Category>1</Metal_Category>
+ <Carcinogen>NO</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>80</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>80</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>799</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>799</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_6.2_M28>0</_6.2_M28>
+ <_6.2_M93>0</_6.2_M93>
+ <Off-Site_Recycled_Total>0</Off-Site_Recycled_Total>
+ <_6.2_M56>0</_6.2_M56>
+ <_6.2_M92>0</_6.2_M92>
+ <Off-Site_Recovery_Total>0</Off-Site_Recovery_Total>
+ <_6.2_M40>0</_6.2_M40>
+ <_6.2_M50>0</_6.2_M50>
+ <_6.2_M54>0</_6.2_M54>
+ <_6.2_M61>0</_6.2_M61>
+ <_6.2_M69>0</_6.2_M69>
+ <_6.2_M95>0</_6.2_M95>
+ <Off-Site_Treated_Total>0</Off-Site_Treated_Total>
+ <Total_Releases>879</Total_Releases>
+ <_8.1_Releases>0</_8.1_Releases>
+ <_8.1a_On-site_Contained_Releases>0</_8.1a_On-site_Contained_Releases>
+ <_8.1b_On-site_Other_Releases>80</_8.1b_On-site_Other_Releases>
+ <_8.1c_Off-site_Contained_Releases>799</_8.1c_Off-site_Contained_Releases>
+ <_8.1d_Off-site_Other_Releases>0</_8.1d_Off-site_Other_Releases>
+ <_8.2_Energy_Recovery_On-site>0</_8.2_Energy_Recovery_On-site>
+ <_8.3_Energy_Recovery_Off-site>0</_8.3_Energy_Recovery_Off-site>
+ <_8.4_Recycling_On-Site>0</_8.4_Recycling_On-Site>
+ <_8.5_Recycling_Off-Site>0</_8.5_Recycling_Off-Site>
+ <_8.6_Treatment_On-site>0</_8.6_Treatment_On-site>
+ <_8.7_Treatement_Off-site>0</_8.7_Treatement_Off-site>
+ <Production_Waste__8.1_thru_8.7_>879</Production_Waste__8.1_thru_8.7_>
+ <_8.8_One-time_Release>0</_8.8_One-time_Release>
+ <_8.9_Production_Ratio>.37</_8.9_Production_Ratio>
+ <Parent_Company_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE</Parent_Company_Name>
+ <Parent_Company_DB_Number>781260336</Parent_Company_DB_Number>
+</row><row>
+ <Year>2008</Year>
+ <TRI_Facility_ID>03801NWNGT165GO</TRI_Facility_ID>
+ <Facility_Name>PUBLIC SERVICE CO OF NEW HAMPSHIRE NEWINGTON STATION</Facility_Name>
+ <Street_Address>165 GOSLING RD</Street_Address>
+ <City>NEWINGTON</City>
+ <County>ROCKINGHAM</County>
+ <ST>NH</ST>
+ <ZIP>03801</ZIP>
+ <Latitude>43.105</Latitude>
+ <Longitude>-70.806944</Longitude>
+ <Primary_SIC/>
+ <SIC_2/>
+ <SIC_3/>
+ <SIC_4/>
+ <SIC_5/>
+ <SIC_6/>
+ <Primary_NAICS>221112</Primary_NAICS>
+ <NAICS_2/>
+ <NAICS_3/>
+ <NAICS_4/>
+ <NAICS_5/>
+ <NAICS_6/>
+ <Doc_Ctrl_Num>1308206796551</Doc_Ctrl_Num>
+ <Chemical>POLYCYCLIC AROMATIC COMPOUNDS</Chemical>
+ <CAS___Compound_ID>N590</CAS___Compound_ID>
+ <Clean_Air_Act_Chemical>YES</Clean_Air_Act_Chemical>
+ <Classification>PBT</Classification>
+ <Metal>NO</Metal>
+ <Metal_Category>0</Metal_Category>
+ <Carcinogen>YES</Carcinogen>
+ <Form_Type>R</Form_Type>
+ <Unit_of_Measure>Pounds</Unit_of_Measure>
+ <_5.1_Fugitive_Air>0</_5.1_Fugitive_Air>
+ <_5.2_Stack_Air>.1</_5.2_Stack_Air>
+ <_5.3_Water>0</_5.3_Water>
+ <_5.4.1_Underground_Class_I>0</_5.4.1_Underground_Class_I>
+ <_5.4.2_Underground_Class_II-V>0</_5.4.2_Underground_Class_II-V>
+ <_5.5.1A_RCRA_C_Landfills>0</_5.5.1A_RCRA_C_Landfills>
+ <_5.5.1B_Other_Landfills>0</_5.5.1B_Other_Landfills>
+ <_5.5.2_Land_Treatment>0</_5.5.2_Land_Treatment>
+ <_5.5.3_Surface_Impoundment>0</_5.5.3_Surface_Impoundment>
+ <_5.5.3A_RCRA_C_Surface_Impoundment>0</_5.5.3A_RCRA_C_Surface_Impoundment>
+ <_5.5.3B_Other_Surface_Impoundment>0</_5.5.3B_Other_Surface_Impoundment>
+ <_5.5.4_Other_Disposal>0</_5.5.4_Other_Disposal>
+ <On-site_Release_Total>.1</On-site_Release_Total>
+ <_6.1_POTW_-_Metals_and_Metal_Compounds>0</_6.1_POTW_-_Metals_and_Metal_Compounds>
+ <_6.1_POTW_-_Non-Metals>0</_6.1_POTW_-_Non-Metals>
+ <_6.1_POTW_-_Total_Transfers>0</_6.1_POTW_-_Total_Transfers>
+ <_6.2_M10>0</_6.2_M10>
+ <_6.2_M41>0</_6.2_M41>
+ <_6.2_M62>0</_6.2_M62>
+ <_6.2_M71>0</_6.2_M71>
+ <_6.2_M81>0</_6.2_M81>
+ <_6.2_M82>0</_6.2_M82>
+ <_6.2_M72>0</_6.2_M72>
+ <_6.2_M63>0</_6.2_M63>
+ <_6.2_M66>0</_6.2_M66>
+ <_6.2_M67>0</_6.2_M67>
+ <_6.2_M64>0</_6.2_M64>
+ <_6.2_M65>0</_6.2_M65>
+ <_6.2_M73>0</_6.2_M73>
+ <_6.2_M79>0</_6.2_M79>
+ <_6.2_M90>0</_6.2_M90>
+ <_6.2_M94>0</_6.2_M94>
+ <_6.2_M99>0</_6.2_M99>
+ <Off-Site_Release_Total>0</Off-Site_Release_Total>
+ <_6.2_M20>0</_6.2_M20>
+ <_6.2_M24>0</_6.2_M24>
+ <_6.2_M26>0</_6.2_M26>
+ <_