Golang xml不';拆封

Golang xml不';拆封,xml,go,unmarshalling,Xml,Go,Unmarshalling,我正在试图破解下面的代码,它的底部是围棋场。data.DocumentType始终返回0,并应返回内部xml 4。有人能告诉我为什么这不起作用吗 package main import ( "encoding/xml" "fmt" ) type doc struct { XMLName xml.Name `xml:"ownershipDocument"` SchemaVersion string `xml:",innerxml"` D

我正在试图破解下面的代码,它的底部是围棋场。data.DocumentType始终返回0,并应返回内部xml 4。有人能告诉我为什么这不起作用吗

package main

import (
    "encoding/xml"
    "fmt"

)

type doc struct {
    XMLName       xml.Name `xml:"ownershipDocument"`
    SchemaVersion string   `xml:",innerxml"`
    DocumentType  int      `xml:",innerxml"`
}

func main() {
    var Data doc
    xml.Unmarshal([]byte(VV), &Data)
    fmt.Println(Data.DocumentType)

}

const VV = `<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0306</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2015-11-18</periodOfReport>

    <issuer>
        <issuerCik>0000820081</issuerCik>
        <issuerName>CAMBREX CORP</issuerName>
        <issuerTradingSymbol>CBM</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001227832</rptOwnerCik>
            <rptOwnerName>KORB WILLIAM B</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>1 MEADOWLANDS PLAZA</rptOwnerStreet1>
            <rptOwnerStreet2></rptOwnerStreet2>
            <rptOwnerCity>EAST RUTHERFORD</rptOwnerCity>
            <rptOwnerState>NJ</rptOwnerState>
            <rptOwnerZipCode>07073</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
            <isOfficer>0</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
        </reportingOwnerRelationship>
    </reportingOwner>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2015-11-18</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>S</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>10000</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>50.18</value>
                    <footnoteId id="F1"/>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>36562</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value></value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">The price reported in Column 4 is a weighted average price. These shares were sold in multiple transactions at prices ranging from $50.00 to $50.58 inclusive. The reporting person undertakes to provide to Cambrex Corporation, any security holder of Cambrex Corporation, or the staff of the Securities and Exchange Commission, upon request, full information regarding the number of shares sold at each separate price within the range set forth in this Footnote 1 to this Form 4.</footnote>
    </footnotes>

    <remarks></remarks>

    <ownerSignature>
        <signatureName>Samantha Hanley for William B. Korb by POA</signatureName>
        <signatureDate>2015-11-20</signatureDate>
    </ownerSignature>
</ownershipDocument>`
主程序包
进口(
“编码/xml”
“fmt”
)
类型doc结构{
XMLName xml.Name`xml:“ownershipDocument”`
SchemaVersion字符串`xml:,innerxml“`
DocumentType int`xml:,innerxml“`
}
func main(){
风险值数据文件
xml.Unmarshal([]字节(VV),&数据)
fmt.Println(数据.文档类型)
}
常数VV=`
X0306
4.
2015-11-18
0000820081
坎布雷克斯公司
煤层气
0001227832
科布威廉B
草地广场1号
东卢瑟福
新泽西州
07073
1.
0
0
0
普通股
2015-11-18
4.
s
0
10000
50.18
D
36562
D
第4栏中报告的价格为加权平均价格。这些股票以50.00美元至50.58美元(含50.58美元)的价格进行了多次交易。报告人承诺应要求向Cambrex Corporation、Cambrex Corporation的任何证券持有人或证券交易委员会的工作人员提供关于在本表4脚注1规定的范围内以每个单独价格出售的股份数量的完整信息。
萨曼莎·汉利为威廉·B·科尔布拍摄POA
2015-11-20
`

删除
DocumentType
上的
innerxml
标记,并为其提供要匹配的元素的名称(
xml:“DocumentType”
)。发件人:

如果结构具有类型为
[]byte
string
且带有标记的字段,则
解组
将原始XML嵌套在该字段中的元素中。其余规则仍然适用

您不需要存储未处理的XML。您正在查找字段的值,因此不需要标记


*编辑:就此而言,
”,innerxml“
标记也会在没有匹配元素的情况下破坏
SchemaVersion
字段(并且由于
SchemaVersion
是一个字符串),它会存储整个文档。

删除
DocumentType
上的
innerxml
标记,并为其指定要匹配的元素的名称(
xml:“documentType”
)。发件人:

I tried to do as much i could please suggest and help . 
I use this method please comment and suggest.  
https://play.golang.org/p/kb0HF8ykHW

  package main;
    import (
        "fmt"
        "encoding/xml"  
    )

    func main(){
    dxml := `
    <?xml version="1.0"?>
    <ownershipDocument>
        <schemaVersion>X0306</schemaVersion>
        <documentType>4</documentType>
        <periodOfReport>2015-11-18</periodOfReport>
        <issuer>
            <issuerCik>0000820081</issuerCik>
            <issuerName>CAMBREX CORP</issuerName>
            <issuerTradingSymbol>CBM</issuerTradingSymbol>
        </issuer>
        <reportingOwner>
            <reportingOwnerId>
                <rptOwnerCik>0001227832</rptOwnerCik>
                <rptOwnerName>KORB WILLIAM B</rptOwnerName>
            </reportingOwnerId>
            <reportingOwnerAddress>
                <rptOwnerStreet1>1 MEADOWLANDS PLAZA</rptOwnerStreet1>
                <rptOwnerStreet2/>
                <rptOwnerCity>EAST RUTHERFORD</rptOwnerCity>
                <rptOwnerState>NJ</rptOwnerState>
                <rptOwnerZipCode>07073</rptOwnerZipCode>
                <rptOwnerStateDescription/>
            </reportingOwnerAddress>
            <reportingOwnerRelationship>
                <isDirector>1</isDirector>
                <isOfficer>0</isOfficer>
                <isTenPercentOwner>0</isTenPercentOwner>
                <isOther>0</isOther>
            </reportingOwnerRelationship>
        </reportingOwner>
        <nonDerivativeTable>
            <nonDerivativeTransaction>
                <securityTitle>
                    <value>Common Stock</value>
                </securityTitle>
                <transactionDate>
                    <value>2015-11-18</value>
                </transactionDate>
                <transactionCoding>
                    <transactionFormType>4</transactionFormType>
                    <transactionCode>S</transactionCode>
                    <equitySwapInvolved>0</equitySwapInvolved>
                </transactionCoding>
                <transactionAmounts>
                    <transactionShares>
                        <value>10000</value>
                    </transactionShares>
                    <transactionPricePerShare>
                        <value>50.18</value>
                        <footnoteId id="F1"/>
                    </transactionPricePerShare>
                    <transactionAcquiredDisposedCode>
                        <value>D</value>
                    </transactionAcquiredDisposedCode>
                </transactionAmounts>
                <postTransactionAmounts>
                    <sharesOwnedFollowingTransaction>
                        <value>36562</value>
                    </sharesOwnedFollowingTransaction>
                </postTransactionAmounts>
                <ownershipNature>
                    <directOrIndirectOwnership>
                        <value>D</value>
                    </directOrIndirectOwnership>
                    <natureOfOwnership>
                        <value/>
                    </natureOfOwnership>
                </ownershipNature>
            </nonDerivativeTransaction>
        </nonDerivativeTable>
        <footnotes>
            <footnote id="F1">The price reported in Column 4 is a weighted average price. These shares were sold in multiple transactions at prices ranging from $50.00 to $50.58 inclusive. The reporting person undertakes to provide to Cambrex Corporation, any security holder of Cambrex Corporation, or the staff of the Securities and Exchange Commission, upon request, full information regarding the number of shares sold at each separate price within the range set forth in this Footnote 1 to this Form 4.</footnote>
        </footnotes>
        <remarks/>
        <ownerSignature>
            <signatureName>Samantha Hanley for William B. Korb by POA</signatureName>
            <signatureDate>2015-11-20</signatureDate>
        </ownerSignature>
    </ownershipDocument>

    `

        defer func() {
            if errD := recover(); errD != nil {
                    fmt.Println("!!!!!!!!!!!!!!!!Panic Occured and Recovered in func main(), Error Info: ", errD)
                }
        }()

        var Owner Ownershipdocs 

        err := xml.Unmarshal([]byte(dxml), &Owner)
            fmt.Println("xml.unmarshal error info :",err)
                fmt.Println("SchemaVersion : ",Owner.SchemaVersion)
                fmt.Println("DocumentType : ",Owner.DocumentType)
                fmt.Println("PeriodOfReport : ",Owner.PeriodOfReport)
                fmt.Println("IssuerCik : ",Owner.IssuerCik)
                fmt.Println("IssuerName : ",Owner.IssuerName)
                fmt.Println("IssuerTradingSymbol : ",Owner.IssuerTradingSymbol)
                fmt.Println("RptOwnerCik : ",Owner.RptOwnerCik)
                fmt.Println("RptOwnerName : ",Owner.RptOwnerName)
                fmt.Println("RptOwnerStreet1 : ",Owner.RptOwnerStreet1)
                fmt.Println("RptOwnerCity :  ",Owner.RptOwnerCity)
                fmt.Println("RptOwnerState : ",Owner.RptOwnerState)
                fmt.Println("RptOwnerZipCode : ",Owner.RptOwnerZipCode)
                fmt.Println("IsDirector : ",Owner.IsDirector)   
                fmt.Println("IsOfficer :  ",Owner.IsOfficer)

                fmt.Println("IsTenPercentOwner : ",Owner.IsTenPercentOwner)
                fmt.Println("IsOther : ",Owner.IsOther)
                fmt.Println("SecurityTitleValue : ",Owner.SecurityTitleValue)
                fmt.Println("TransactionDatevalue : ",Owner.TransactionDatevalue)
                fmt.Println("TransactionFormType : ",Owner.TransactionFormType)
                fmt.Println("TransactionCode : ",Owner.TransactionCode)
                fmt.Println("EquitySwapInvolved : ",Owner.EquitySwapInvolved)
                fmt.Println("TransactionSharesValue : ",Owner.TransactionSharesValue)
                fmt.Println("TransactionPricePerShareValue : ",Owner.TransactionPricePerShareValue)
                fmt.Println("TransactionPricePerSharefootnoteId :  ",Owner.TransactionPricePerSharefootnoteId)
                fmt.Println("TransactionAcquiredDisposedCodeValue : ",Owner.TransactionAcquiredDisposedCodeValue)

                fmt.Println("Footnote.Footnote : ",Owner.Footnote.Footnote)
                fmt.Println("OwnerSignaturesignatureName : ",Owner.OwnerSignaturesignatureName)
                fmt.Println("OwnerSignaturesignatureDate    : ",Owner.OwnerSignaturesignatureDate)  

    }

    type Ownershipdocs struct{
        SchemaVersion           string `xml:"schemaVersion"`
        DocumentType            string `xml:"documentType"`
        PeriodOfReport          string `xml:"periodOfReport"`
        IssuerCik               string `xml:"issuer>issuerCik"`
        IssuerName              string `xml:"issuer>issuerName"`
        IssuerTradingSymbol     string `xml:"issuer>issuerTradingSymbol"`
        RptOwnerCik             string `xml:"reportingOwner>reportingOwnerId>rptOwnerCik"`
        RptOwnerName            string `xml:"reportingOwner>reportingOwnerId>rptOwnerName"`

        RptOwnerStreet1         string `xml:"reportingOwner>reportingOwnerAddress>rptOwnerStreet1"`
        RptOwnerCity            string `xml:"reportingOwner>reportingOwnerAddress>rptOwnerCity"`
        RptOwnerState           string `xml:"reportingOwner>reportingOwnerAddress>rptOwnerState"`
        RptOwnerZipCode         string `xml:"reportingOwner>reportingOwnerAddress>rptOwnerZipCode"`

        IsDirector              string `xml:"reportingOwner>reportingOwnerRelationship>isDirector"`
        IsOfficer               string `xml:"reportingOwner>reportingOwnerRelationship>isOfficer"`  
        IsTenPercentOwner       string `xml:"reportingOwner>reportingOwnerRelationship>isTenPercentOwner"`
        IsOther                 string `xml:"reportingOwner>reportingOwnerRelationship>isOther"`        

        SecurityTitleValue      string `xml:"nonDerivativeTable>nonDerivativeTransaction>securityTitle>value"`
        TransactionDatevalue    string `xml:"nonDerivativeTable>nonDerivativeTransaction>transactionDate>value"`    
        TransactionFormType     string `xml:"nonDerivativeTable>nonDerivativeTransaction>transactionCoding>transactionFormType"`
        TransactionCode         string `xml:"nonDerivativeTable>nonDerivativeTransaction>transactionCoding>transactionCode"`
        EquitySwapInvolved      string `xml:"nonDerivativeTable>nonDerivativeTransaction>transactionCoding>equitySwapInvolved"`


        TransactionSharesValue                  string `xml:"nonDerivativeTable>nonDerivativeTransaction>transactionAmounts>transactionShares>value"`
        TransactionPricePerShareValue           string `xml:"nonDerivativeTable>nonDerivativeTransaction>transactionAmounts>transactionPricePerShare>value"`
        TransactionPricePerSharefootnoteId      string `xml:"nonDerivativeTable>nonDerivativeTransaction>transactionAmounts>transactionPricePerShare>footnoteId"`
        TransactionAcquiredDisposedCodeValue    string `xml:"nonDerivativeTable>nonDerivativeTransaction>transactionAmounts>transactionAcquiredDisposedCode>value"`

        SharesOwnedFollowingTransactionValue    string `xml:"nonDerivativeTable>nonDerivativeTransaction>ownershipNature>directOrIndirectOwnership>value"`

        Footnote                                Footnotes   `xml:"footnotes"`
        OwnerSignaturesignatureName             string       `xml:"ownerSignature>signatureName"`
        OwnerSignaturesignatureDate             string       `xml:"ownerSignature>signatureDate"`

    }

    type Footnotes struct{
        ID          string `xml:"id,attr"`
        Footnote    string `xml:"footnote"`

    }
如果结构具有类型为
[]byte
string
且带有标记的字段,则
解组
将原始XML嵌套在该字段中的元素中。其余规则仍然适用

您不需要存储未处理的XML。您正在查找字段的值,因此不需要标记

*编辑:就此而言,
”,innerxml“
标记也会在没有匹配元素的情况下破坏
SchemaVersion
字段(并且由于
SchemaVersion
是一个字符串),它会存储整个文档。

我尽了最大努力,请提供建议和帮助。
I tried to do as much i could please suggest and help . 
I use this method please comment and suggest.  
https://play.golang.org/p/kb0HF8ykHW

  package main;
    import (
        "fmt"
        "encoding/xml"  
    )

    func main(){
    dxml := `
    <?xml version="1.0"?>
    <ownershipDocument>
        <schemaVersion>X0306</schemaVersion>
        <documentType>4</documentType>
        <periodOfReport>2015-11-18</periodOfReport>
        <issuer>
            <issuerCik>0000820081</issuerCik>
            <issuerName>CAMBREX CORP</issuerName>
            <issuerTradingSymbol>CBM</issuerTradingSymbol>
        </issuer>
        <reportingOwner>
            <reportingOwnerId>
                <rptOwnerCik>0001227832</rptOwnerCik>
                <rptOwnerName>KORB WILLIAM B</rptOwnerName>
            </reportingOwnerId>
            <reportingOwnerAddress>
                <rptOwnerStreet1>1 MEADOWLANDS PLAZA</rptOwnerStreet1>
                <rptOwnerStreet2/>
                <rptOwnerCity>EAST RUTHERFORD</rptOwnerCity>
                <rptOwnerState>NJ</rptOwnerState>
                <rptOwnerZipCode>07073</rptOwnerZipCode>
                <rptOwnerStateDescription/>
            </reportingOwnerAddress>
            <reportingOwnerRelationship>
                <isDirector>1</isDirector>
                <isOfficer>0</isOfficer>
                <isTenPercentOwner>0</isTenPercentOwner>
                <isOther>0</isOther>
            </reportingOwnerRelationship>
        </reportingOwner>
        <nonDerivativeTable>
            <nonDerivativeTransaction>
                <securityTitle>
                    <value>Common Stock</value>
                </securityTitle>
                <transactionDate>
                    <value>2015-11-18</value>
                </transactionDate>
                <transactionCoding>
                    <transactionFormType>4</transactionFormType>
                    <transactionCode>S</transactionCode>
                    <equitySwapInvolved>0</equitySwapInvolved>
                </transactionCoding>
                <transactionAmounts>
                    <transactionShares>
                        <value>10000</value>
                    </transactionShares>
                    <transactionPricePerShare>
                        <value>50.18</value>
                        <footnoteId id="F1"/>
                    </transactionPricePerShare>
                    <transactionAcquiredDisposedCode>
                        <value>D</value>
                    </transactionAcquiredDisposedCode>
                </transactionAmounts>
                <postTransactionAmounts>
                    <sharesOwnedFollowingTransaction>
                        <value>36562</value>
                    </sharesOwnedFollowingTransaction>
                </postTransactionAmounts>
                <ownershipNature>
                    <directOrIndirectOwnership>
                        <value>D</value>
                    </directOrIndirectOwnership>
                    <natureOfOwnership>
                        <value/>
                    </natureOfOwnership>
                </ownershipNature>
            </nonDerivativeTransaction>
        </nonDerivativeTable>
        <footnotes>
            <footnote id="F1">The price reported in Column 4 is a weighted average price. These shares were sold in multiple transactions at prices ranging from $50.00 to $50.58 inclusive. The reporting person undertakes to provide to Cambrex Corporation, any security holder of Cambrex Corporation, or the staff of the Securities and Exchange Commission, upon request, full information regarding the number of shares sold at each separate price within the range set forth in this Footnote 1 to this Form 4.</footnote>
        </footnotes>
        <remarks/>
        <ownerSignature>
            <signatureName>Samantha Hanley for William B. Korb by POA</signatureName>
            <signatureDate>2015-11-20</signatureDate>
        </ownerSignature>
    </ownershipDocument>

    `

        defer func() {
            if errD := recover(); errD != nil {
                    fmt.Println("!!!!!!!!!!!!!!!!Panic Occured and Recovered in func main(), Error Info: ", errD)
                }
        }()

        var Owner Ownershipdocs 

        err := xml.Unmarshal([]byte(dxml), &Owner)
            fmt.Println("xml.unmarshal error info :",err)
                fmt.Println("SchemaVersion : ",Owner.SchemaVersion)
                fmt.Println("DocumentType : ",Owner.DocumentType)
                fmt.Println("PeriodOfReport : ",Owner.PeriodOfReport)
                fmt.Println("IssuerCik : ",Owner.IssuerCik)
                fmt.Println("IssuerName : ",Owner.IssuerName)
                fmt.Println("IssuerTradingSymbol : ",Owner.IssuerTradingSymbol)
                fmt.Println("RptOwnerCik : ",Owner.RptOwnerCik)
                fmt.Println("RptOwnerName : ",Owner.RptOwnerName)
                fmt.Println("RptOwnerStreet1 : ",Owner.RptOwnerStreet1)
                fmt.Println("RptOwnerCity :  ",Owner.RptOwnerCity)
                fmt.Println("RptOwnerState : ",Owner.RptOwnerState)
                fmt.Println("RptOwnerZipCode : ",Owner.RptOwnerZipCode)
                fmt.Println("IsDirector : ",Owner.IsDirector)   
                fmt.Println("IsOfficer :  ",Owner.IsOfficer)

                fmt.Println("IsTenPercentOwner : ",Owner.IsTenPercentOwner)
                fmt.Println("IsOther : ",Owner.IsOther)
                fmt.Println("SecurityTitleValue : ",Owner.SecurityTitleValue)
                fmt.Println("TransactionDatevalue : ",Owner.TransactionDatevalue)
                fmt.Println("TransactionFormType : ",Owner.TransactionFormType)
                fmt.Println("TransactionCode : ",Owner.TransactionCode)
                fmt.Println("EquitySwapInvolved : ",Owner.EquitySwapInvolved)
                fmt.Println("TransactionSharesValue : ",Owner.TransactionSharesValue)
                fmt.Println("TransactionPricePerShareValue : ",Owner.TransactionPricePerShareValue)
                fmt.Println("TransactionPricePerSharefootnoteId :  ",Owner.TransactionPricePerSharefootnoteId)
                fmt.Println("TransactionAcquiredDisposedCodeValue : ",Owner.TransactionAcquiredDisposedCodeValue)

                fmt.Println("Footnote.Footnote : ",Owner.Footnote.Footnote)
                fmt.Println("OwnerSignaturesignatureName : ",Owner.OwnerSignaturesignatureName)
                fmt.Println("OwnerSignaturesignatureDate    : ",Owner.OwnerSignaturesignatureDate)  

    }

    type Ownershipdocs struct{
        SchemaVersion           string `xml:"schemaVersion"`
        DocumentType            string `xml:"documentType"`
        PeriodOfReport          string `xml:"periodOfReport"`
        IssuerCik               string `xml:"issuer>issuerCik"`
        IssuerName              string `xml:"issuer>issuerName"`
        IssuerTradingSymbol     string `xml:"issuer>issuerTradingSymbol"`
        RptOwnerCik             string `xml:"reportingOwner>reportingOwnerId>rptOwnerCik"`
        RptOwnerName            string `xml:"reportingOwner>reportingOwnerId>rptOwnerName"`

        RptOwnerStreet1         string `xml:"reportingOwner>reportingOwnerAddress>rptOwnerStreet1"`
        RptOwnerCity            string `xml:"reportingOwner>reportingOwnerAddress>rptOwnerCity"`
        RptOwnerState           string `xml:"reportingOwner>reportingOwnerAddress>rptOwnerState"`
        RptOwnerZipCode         string `xml:"reportingOwner>reportingOwnerAddress>rptOwnerZipCode"`

        IsDirector              string `xml:"reportingOwner>reportingOwnerRelationship>isDirector"`
        IsOfficer               string `xml:"reportingOwner>reportingOwnerRelationship>isOfficer"`  
        IsTenPercentOwner       string `xml:"reportingOwner>reportingOwnerRelationship>isTenPercentOwner"`
        IsOther                 string `xml:"reportingOwner>reportingOwnerRelationship>isOther"`        

        SecurityTitleValue      string `xml:"nonDerivativeTable>nonDerivativeTransaction>securityTitle>value"`
        TransactionDatevalue    string `xml:"nonDerivativeTable>nonDerivativeTransaction>transactionDate>value"`    
        TransactionFormType     string `xml:"nonDerivativeTable>nonDerivativeTransaction>transactionCoding>transactionFormType"`
        TransactionCode         string `xml:"nonDerivativeTable>nonDerivativeTransaction>transactionCoding>transactionCode"`
        EquitySwapInvolved      string `xml:"nonDerivativeTable>nonDerivativeTransaction>transactionCoding>equitySwapInvolved"`


        TransactionSharesValue                  string `xml:"nonDerivativeTable>nonDerivativeTransaction>transactionAmounts>transactionShares>value"`
        TransactionPricePerShareValue           string `xml:"nonDerivativeTable>nonDerivativeTransaction>transactionAmounts>transactionPricePerShare>value"`
        TransactionPricePerSharefootnoteId      string `xml:"nonDerivativeTable>nonDerivativeTransaction>transactionAmounts>transactionPricePerShare>footnoteId"`
        TransactionAcquiredDisposedCodeValue    string `xml:"nonDerivativeTable>nonDerivativeTransaction>transactionAmounts>transactionAcquiredDisposedCode>value"`

        SharesOwnedFollowingTransactionValue    string `xml:"nonDerivativeTable>nonDerivativeTransaction>ownershipNature>directOrIndirectOwnership>value"`

        Footnote                                Footnotes   `xml:"footnotes"`
        OwnerSignaturesignatureName             string       `xml:"ownerSignature>signatureName"`
        OwnerSignaturesignatureDate             string       `xml:"ownerSignature>signatureDate"`

    }

    type Footnotes struct{
        ID          string `xml:"id,attr"`
        Footnote    string `xml:"footnote"`

    }
我使用这种方法,请评论和建议。 https://play.golang.org/p/kb0HF8ykHW 主包装; 进口( “fmt” “编码/xml” ) func main(){ dxml:=` X0306 4. 2015-11-18 0000820081 坎布雷克斯公司 煤层气 0001227832 科布威廉B 草地广场1号 东卢瑟福 新泽西州 07073 1. 0 0 0 普通股 2015-11-18 4. s 0 10000 50.18 D 36562 D 第4栏中报告的价格为加权平均价格。这些股票在多次交易中以50.00美元至50.58美元(含50.58美元)的价格出售。报告人承诺根据要求向Cambrex Corporation、Cambrex Corporation的任何证券持有人或证券交易委员会的工作人员提供完整信息表4脚注1中规定的范围内,以每一单独价格出售的股份数量的确认。 萨曼莎·汉利为威廉·B·科尔布拍摄POA 2015-11-20 ` 延迟函数(){ 如果出现错误:=恢复();er